Thread: Dialog Troubles

  1. #1
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790

    Dialog Troubles

    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?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    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

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    76
    You must be calling IsDialogMessage even after the modeless dialog closes. Show us what your program's message loop looks like.

  4. #4
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    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
    }
    Control dialog being the handle to my dialog box, the otherstuff involving my opengl.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. Edit controls of a dialog from another dialog...
    By Snake in forum Windows Programming
    Replies: 9
    Last Post: 07-01-2005, 02:18 PM
  3. make Child Dialog not Popup?
    By Zeusbwr in forum Windows Programming
    Replies: 5
    Last Post: 04-08-2005, 02:42 PM
  4. Getting the position of a dialog without parent on the screen
    By stormbringer in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2003, 02:59 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM