您的位置:首页 > 编程语言

CnCrypt代码 之 为对话框动态增加菜单

2016-07-15 17:39 225 查看
动态增加菜单后,需要将对话框的大小进行调整。

RECT rtWindow;
::GetWindowRect(hwndDlg, &rtWindow);
::ClientToScreen(hwndDlg, (LPPOINT)&rtWindow);
::ClientToScreen(hwndDlg, ((LPPOINT)&rtWindow) + 1);
// update the size of the owner
rtWindow.bottom += GetSystemMetrics(SM_CXMENUSIZE);;
SetWindowPos(hwndDlg, NULL, rtWindow.left, rtWindow.top, rtWindow.right - rtWindow.left, rtWindow.bottom - rtWindow.top, SWP_NOMOVE | SWP_NOZORDER);

SetMenu(hwndDlg, LoadMenu(g_hInstance, MAKEINTRESOURCE(IDR_MENU_MINI_MODE)));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息