一段隐藏对话框程序的代码,实际上就是截获WM_SHOWWINDOW
frman 2005-10-30 03:55:00 void CDlg::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);
}
}
实际上把最后一句CDialog::OnSHowWindow(SW_HIDE, nStatus); 注释掉也没关系
好象就是::SetWindowLong(*this, GWL_STYLE, Style | WS_VISIBLE);在起作用。
不知哪位高手可以具体解释下这是为什么?