In OnInitDialog function
LoadMenu
SetMenu
Add this menu bar and then maximize ShowWindow (SW_MAXIMIZE); Dialog cannot be covered with a screen, and on the right there is space on the Windows taskbar
As shown in figure
If manual point window to maximize the minimize button is normal
If you remove the menu bar, and maximize the initial normal
New project with the menu bar, the initial maximize is normal (no test status bar that add menu bar toolbar)
Excuse me how should I check
CodePudding user response:
AdjustWindowRectExCodePudding user response:
Try to deliver WM_SYSCOMMAND message
BOOL CTestDlgDlg: : OnCommand (WPARAM WPARAM, LPARAM LPARAM)
{
If (wParam==IDM_MAXSIZE)
{
PostMessage (WM_SYSCOMMAND, SC_MAXIMIZE, 0);
}
If (wParam==IDM_RESTORE)
{
PostMessage (WM_SYSCOMMAND, SC_RESTORE, 0);
}
Return CDialog: : OnCommand (wParam, lParam);
}
CodePudding user response: