Archived

This topic is now archived and is closed to further replies.

chris1234

Multiple Dialog windows

Recommended Posts

I''m making an application which needs to be able to have more then 1 dialog window open at the sametime. I started the project under visual c++ 6.0 as an win32 application. I do not want to use the MFC AppWizzard mainly ''cause I''ll later on I want 1 window (non-dialog) to display OpenGL...but now I just want more then 1 dialog open at once...I made my main dialog window but when I try to open an other one, just a simple messagebox the entire application closes I open the messagebox in my Dialogprocedure when I press a button as you can see below in part of MainDlgProc(); INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) { switch( msg ) { case WM_INITDIALOG: break; case WM_COMMAND: switch( LOWORD(wParam) ) { case IDC_DIALOG: MessageBox(hwnd2, "test", "test1", MB_OK | MB_ICONEXCLAMATION); break; } break; case WM_DESTROY: PostQuitMessage(0); break; } return FALSE; // Message not handled } can anyone tell me what I''m doing wrong? how do I open another dialog from within another...and is it a lot different to open an window for displaying openGL then opening a 2nd dialog window? Chris

Share this post


Link to post
Share on other sites
Look up modeless dialogs.

try MSDN at Microsoft.

I can''t remember any specifics at this moment, sorry. It has been some time since I have used modeless dialogs, involves stuff like message pumps and the like.

Good luck.


D.V.

Share this post


Link to post
Share on other sites