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

来源:互联网 发布:java的switch里的 编辑:程序博客网 时间:2024/06/06 06:42

动态增加菜单后,需要将对话框的大小进行调整。

RECT rtWindow;::GetWindowRect(hwndDlg, &rtWindow);::ClientToScreen(hwndDlg, (LPPOINT)&rtWindow);::ClientToScreen(hwndDlg, ((LPPOINT)&rtWindow) + 1);// update the size of the ownerrtWindow.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)));


0 0
原创粉丝点击