Thread: Dialog not opening...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    18

    Unhappy Dialog not opening... (Reviewed)

    Okay, I checked what was wrong and tried adding different objects to the dialog.. it seems that when I add Common Controls such as progress bars or listviews, the dialog does not show. However, all other objects such as buttons, picture boxes and check boxes do not make any difference.. Is there anything I'm missing?? Here's the code:

    Code:
    #include <windows.h>
    #include "resource.h"
    #include <commctrl.h>
    
    BOOL MainDialog_OnCommand(HWND hWnd, WORD wCommand, WORD wNotify, HWND hControl);
    BOOL MainDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
    
    int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { 
    	DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_DIALOG1),NULL,(DLGPROC)MainDialogProc,0); 
    	return 0; 
    }
    BOOL MainDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
    	switch (uMsg)
    	{
    	case WM_COMMAND:
    		return MainDialog_OnCommand(hWnd, LOWORD(wParam), HIWORD(wParam), (HWND)lParam);
    		break;
    	case WM_CLOSE:
    		EndDialog(hWnd,0);
    		return TRUE;
    	}
    	return FALSE;
    }
    BOOL MainDialog_OnCommand(HWND hWnd, WORD wCommand, WORD wNotify, HWND hControl)
    {
    	switch (wCommand)
    	{
    	case IDOK:
    	case IDCANCEL:
    		EndDialog(hWnd,0);
    		return TRUE;
    	}
    	return TRUE;
    }
    Last edited by void; 10-19-2002 at 05:20 PM.
    ~void

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. make Child Dialog not Popup?
    By Zeusbwr in forum Windows Programming
    Replies: 5
    Last Post: 04-08-2005, 02:42 PM
  2. Having Trouble Opening My Dialog Box
    By ElWhapo in forum Windows Programming
    Replies: 8
    Last Post: 12-28-2004, 12:13 PM
  3. 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
  4. opening a dialog window from inside a dialog window
    By uvacow in forum C++ Programming
    Replies: 1
    Last Post: 12-02-2002, 09:27 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM