Ok, here is the problem, I have made myself a modeless dialog box in my 3ds modelviewer project. However, when I run the program, even if I exit the dialog box, I cannot regain control of the main window, how can I do this?
This is a discussion on Dialog Troubles within the Windows Programming forums, part of the Platform Specific Boards category; Ok, here is the problem, I have made myself a modeless dialog box in my 3ds modelviewer project. However, when ...
Ok, here is the problem, I have made myself a modeless dialog box in my 3ds modelviewer project. However, when I run the program, even if I exit the dialog box, I cannot regain control of the main window, how can I do this?
What does that mean? Your main window will no longer recieve focus?
Are you using MFC? or what?
Does the problem only occur after you create/show the dialog box?
gg
You must be calling IsDialogMessage even after the modeless dialog closes. Show us what your program's message loop looks like.
Peter O. Programming tips
Control dialog being the handle to my dialog box, the otherstuff involving my opengl.Code:WPARAM MainLoop() { MSG msg; while(1) // Do our infinate loop { // Check if there was a message if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (ControlDialog == 0 || !IsDialogMessage(ControlDialog,&msg)) { if(msg.message == WM_QUIT) // If the message wasnt to quit break; TranslateMessage(&msg); // Find out what the message does DispatchMessage(&msg); // Execute the message }k } else // if there wasn't a message { for (int i = 0; i < MAX_GLOBES;i++) { globe[i].RotateAroundPoint(globe[0].Position, SPEED * g_FrameInterval, 0, 1, 0); } g_Camera.Update(); // Update the camera every frame RenderScene(); // Render the scene every frame } } DeInit(); // Clean up and free all allocated memory return(msg.wParam); // Return from the program }