I just want a c# application with a hidden main window that will process and respond to window messages.
I can create a form without showing it, and can then call Ap
You can create a class that inherits from System.Windows.Forms.NativeWindow (which provides basic message loop capability) and reference the Handle property in its constructor to create its handle and hook it into the message loop. Once you call Application.Run, you will be able to process messages from it.