bool SetWindowTop(CWnd* pWnd)
{
if(!pWnd)
{
return false;
}
if(pWnd->GetExStyle()&WS_EX_TOPMOST)
{
return true;
}
else
{
int i= pWnd->SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
if (i==0)
return false;
else
return true;
}
}
//取消窗口置顶
CancelWindowTop(CWnd* pWnd)
{
if(pWnd)
{
int x=pWnd->SetWindowPos(&CWnd::wndNoTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
if(x==0)
return false;
else
return true;
}
else
{
return false;
}
}
原文地址:http://www.cnblogs.com/zhaoxinshanwei/p/3851004.html