CString str;
GetDlgItemTextW(IDC_ZD,str);//IDC_ZD为控件按钮,按钮的文字为置顶
CRect rect;
GetWindowRect(&rect);//获取窗口位置
if( str == "置顶")
{
SetWindowPos( &wndTopMost, rect.left,rect.top,rect.right ,rect.bottom, SWP_NOMOVE||SWP_NOSIZE); //置顶
SetDlgItemTextW(IDC_ZD,L"取消");
}
else
{
this->SetWindowPos(&wndNoTopMost, rect.left,rect.top,rect.right ,rect.bottom, SWP_NOSIZE);
SetDlgItemTextW(IDC_ZD,L"置顶");//取消置顶
}
贵有恒,何必三更眠五更起。最无益,只怕一日曝十日寒。
浙公网安备 33010602011771号