void CDlgBaseDlg::OnBnClickedButton1()
{
CWnd *pWnd=FindWindowW(NULL,L"Win32 API: Platform SDK");
if (pWnd==NULL)
{
MessageBox(L"Find Failed");
return ;
}
WINDOWPLACEMENT pla;
pla.length=sizeof(WINDOWPLACEMENT);
pWnd->GetWindowPlacement(&pla);
if (pla.showCmd!=SW_HIDE)
{
pla.showCmd=SW_HIDE;
MessageBox(L"Not Hide");
}
else
{
pla.showCmd=SW_SHOW;
MessageBox(L"Hide");
}

CString str;
str.Format(L"%d",pla.showCmd);
MessageBox(str);
pWnd->SetWindowPlacement(&pla);
pWnd->ShowWindow(pla.showCmd);
pWnd->GetWindowPlacement(&pla);
str.Format(L"%d",pla.showCmd);
MessageBox(str);
}
窗口第一次点击按钮的时候可以隐藏,但是后来就不能显示了
经过代码调试.发现SetWindowPlacement()貌似没有起到效果.用pla去set之后用getplacement,
发现get的结果不等于pla中pla.showCmd的值
难道是SetWindowPlacement失败了?