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)));
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)));
相关文章推荐
- android 代码实现控件之间的间距
- 底部Popwindow形式菜单的类的封装
- [Android]在代码里运行另一个程序的方法
- 肯特·贝克:改变人生的代码整理魔法
- 一步一步跟我学易语言之第二个易程序菜单设计
- IE右键菜单被修改
- 网页恶意代码的预防
- MooBox 基于Mootools的对话框插件
- 高手写的Tracer-Flash代码调试类代码下载
- jQuery菜单插件用法实例
- 基于jQuery实现带动画效果超炫酷的弹出对话框(附源码下载)
- CSS代码缩写技巧
- 非主流Q-zOne代码代码搜集第1/2页
- ASP动态级联菜单实现代码
- CreateWeb.vbs 代码
- Lua中编译执行代码相关的函数详解
- C#实现在前端网页弹出警告对话框(alert)的方法
- jQuery实现的超酷苹果风格图标滑出菜单效果代码
- 更有效率的css代码编写第1/3页
- Div+Js实现的带阴影菜单 微软以前网站曾用过