对话框的隐藏
来源:互联网 发布:royce巧克力淘宝假货 编辑:程序博客网 时间:2024/05/21 22:25
1.在OnInitDialog中添加
WINDOWPLACEMENT wp;
wp.length=sizeof(WINDOWPLACEMENT);
wp.flags=WPF_RESTORETOMAXIMIZED;
wp.showCmd=SW_HIDE;
SetWindowPlacement(&wp);
ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);
2.重写OnWindowPosChanging函数
void CXXXDlg::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{
if (lpwndpos->flags & SWP_SHOWWINDOW)
{
lpwndpos->flags &= ~SWP_SHOWWINDOW;
PostMessage(WM_WINDOWPOSCHANGING, 0, (LPARAM)lpwndpos);
ShowWindow(SW_HIDE);
}
else
CDialog::OnWindowPosChanging(lpwndpos);
}
3.重写DefWindowProc函数
LRESULT CXXXDlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(message==133 )
ShowWindow(SW_HIDE);
return CDialog::DefWindowProc(message, wParam, lParam);
}
4.重写OnShowWindow函数
void CXXXDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
if( GetStyle() & WS_VISIBLE )
{
CDialog::OnShowWindow(bShow, nStatus);
}
else
{
long Style = ::GetWindowLong(*this, GWL_STYLE);
::SetWindowLong(*this, GWL_STYLE, Style | WS_VISIBLE);
CDialog::OnShowWindow(SW_HIDE, nStatus);
}
}
另外,隐藏任务栏图标,可修改窗口的扩展样式
隐藏任务栏图标:ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);
显示任务栏图标:ModifyStyleEx(WS_EX_TOOLWINDOW, WS_EX_APPWINDOW);
- 隐藏对话框的标题栏
- 隐藏对话框的标题栏
- 对话框的隐藏
- 对话框的隐藏
- 对话框隐藏的简单实现
- 有效的隐藏对话框窗口
- 对话框启动时的隐藏
- 模态对话框的隐藏
- 模态对话框的隐藏
- MFC隐藏对话框的状态栏
- 对话框的隐藏和出现
- 隐藏对话框
- 隐藏对话框
- 隐藏对话框
- 对话框隐藏的几种方法
- 启动隐藏对话框的简单例子
- 对话框隐藏的几种方法
- 几种MFC对话框的隐藏方法
- SQL Schema Comparison with Visual Studio 2010
- hibernate id 映射配置
- Tuning Nagios For Maximum Performance
- SQL Data Comparison with Visual Studio 2010
- mysql的三种安装方式:RPM 二进制包和源代码
- 对话框的隐藏
- Linux指令积累
- (转)struts2的零配置
- ASP.NET中的callback实现机制总结
- 接口 interface
- PopMenu效果的学习
- 数据库Backup/restore, 数据库同步, 数据库比较(Schema,Data)
- subclipse删除package时事务过期的解决(Transaction is out of date)
- xenoprof的安装