-
How do I get another window in the same instance as my orginal but have its own control? When I try it, if I close the second window it ends the program. I dont want that. When I create another window away from the instance, it becomes modal and it will not let me interact with first window. Prob something simple I am sure.
-
Have a separate window procedure for the second window, unless they're identical, in which case don't call PostQuitMessage unless all the windows have closed.
-
Should it use the same class and instance? Or should I create a new one?
-
Huh? Are you using MFC or some other framework method?
Either way I think a separate instance is better.
-
No standard windows api. Sorry I realized asking about the class was stupid after I hit post. I meant the windows class you register, and the answer is no. But I will create a new instance and see if that works.
-
You can use the same window class (I see what you mean now, sorry!). But you may need to find some way of differentiating between the two windows in the event handler -- try using SetWindowLong(..., GWL_USERDATA) and GetWindowLong to store identifiers.
-
Ok I got it to work. Thanks for that SetWindow And GetWindow, I would not have tought of that. :)
-
Neither did I...I first noticed it in Microsoft's COM samples in the platform SDK and thought "that's a good idea"...so I used it in my Window class.
-
Got another question, how do you have a window that is not displayed in the title bar?
-
I mean task bar. :( I need to get more sleep.
-
It's gibbering something about Tool Windows in the help...
Okay -- the only reasonable thing I can find is:
1. Create a hidden window
2. Use that as the parent of your window
This will prevent a taskbar button...hopefully :D
-
Yuck!!!!
There must be a better way.