I'm trying to create a modeless dialog as the main window of a program but it doesn't seem to respond WM_DESTROY or WM_NCDESTROY Message.
HWND hwnd=CreateDialogParamA(hInst,MAKEINTRESOURCE(IDD_DIALOG1),0,DialogProc,LPARAM(this));
if (!hwnd)
{
MessageBox(0, "Failed to create wnd", 0, 0);
return NULL;
}
ShowWindow(hwnd,nCmd);
UpdateWindow(hwnd);
while (GetMessage (&msg, NULL, 0, 0) > 0)
{
if (!IsWindow(hwnd) || !IsDialogMessage(hwnd,&msg))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
}
Modeless Style format from Resource file
STYLE DS_SETFONT | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU