start winforms application without displaying it until receive signal?
-
I am writing a program which will use another application for communicating with, but I want to load this other application in the background when my main application loads, and then just send a windows message to my "background" application telling it to show/hide... What I have done now is to have the "background" application started from the main application with a Process.start(filename). In the background app the code to run it looks like this:
Application.Run(new BackgroundAppFrame())
(from it's "static main" method). However it doesn't seem to be possible to do this without the frame being displayed (I guess the Application.Run() first invokes the constructor and then sets it visible or something like that... And then of course Application.Run() will block so I cannot set the hidden property). Any suggestions on how to solve this? Set the size to 0 instead? Or move it out of screen? If you have a clean solution to this problem please tell me.. -
I am writing a program which will use another application for communicating with, but I want to load this other application in the background when my main application loads, and then just send a windows message to my "background" application telling it to show/hide... What I have done now is to have the "background" application started from the main application with a Process.start(filename). In the background app the code to run it looks like this:
Application.Run(new BackgroundAppFrame())
(from it's "static main" method). However it doesn't seem to be possible to do this without the frame being displayed (I guess the Application.Run() first invokes the constructor and then sets it visible or something like that... And then of course Application.Run() will block so I cannot set the hidden property). Any suggestions on how to solve this? Set the size to 0 instead? Or move it out of screen? If you have a clean solution to this problem please tell me..From your previous post, you're going about this the wrong way. Introducing a second application for such a small operation will just make your application that much more difficult to support. You haven't made drag and drop easier by creating a second application, only more difficult. Check into that article I replied to your previous post and you'll be able to put together a modal form that itself can host multiple forms where you can then do what you were talking about. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome