What is the best way to write an application which runs in one single
process multiple main application windows?
What I already managed to do:
in the Main() method I geneate a new mainform, show() it and then call
Application.Run().
To open a new mainform I start a new thread which creates a new form
shows it and runs Application.Run().
To close an application mainform I call Application.Exitthread().
And to close the entire process I call Application.Exit from within a
window.
This all works fine for now.
What I am still trying to figure out:
How can I prevent my program to run 2 processes simultaneously?
When the program is already running in possibly many mainforms (but
within one process with many threads) I want that when launching the
..exe file NO new process is generated but only a new thread with a new
mainform.
I think I will need some kind of interprocesscommunication to achieve
get there. Does anybody now the canonical way to do this? I don't want
to re-invent the wheel ;-)
Regards
Stephan
|