I'm opening a dialog with DialogBoxW
and for whatever reason, its system menu (the titlebar menu) uses the classic theme (unthemed) style and acts weird. The menu items in it only actually perform the actions half the time, and the rest of the time, it just reopens the menu again. Here's my DlgProc.
void DlgProc(
HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch (uMsg)
{
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_INITDIALOG:
{
HWND hFileLabel = GetDlgItem(hWnd, IDD_OPENWITH_FILE);
SetWindowTextW(hFileLabel, szFileName);
break;
}
default:
DefWindowProcW(hWnd, uMsg, wParam, lParam);
break;
}
}
I've added the Common Controls 6.0 dependency and the dialog itself is themed so I don't know why this is happening.
That's not a valid dialog procedure. A dialog procedure must have this signature:
The dialog manager uses the return value for various things. Since your "dialog procedure" doesn't return a value, the dialog manager is operating on indeterminate values. The behavior is thus undefined.