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;
}
}
vc 使窗口置顶 在最前面
时间: 2024-10-07 18:46:15