Make sure your dialog has the correct properties such as WS_OVERLAPPED. You will need to call RegisterClass before CreateDialog. You'll also need to add IsDialogMessage to your message loop.
dialog.rc:
DialogApp DIALOG DISCARDABLE 0, 0, 416, 229
STYLE WS_OVERLAPPED | WS_MINIMIZEBOX | WS_CAPTION
CLASS "DialogApp"
FONT 8, "Times New Roman"
BEGIN
PUSHBUTTON "Ok",IDOK,214,191,50,14
END
WinMain():
szAppName = "DialogApp"
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = DLGWINDOWEXTRA;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon (hInstance, szAppName);
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName;
if (RegisterClass(&wndclass)==0)
{
return 0;
}
hwnd = CreateDialog( hInstance, szAppName, 0, NULL);
while (GetMessage(&msg, NULL, 0, 0))
{
if (!IsDialogMessage (hwnd, &msg))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}