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;
}