让程序窗口总是在最前面

UpdateData(true);

 if(m_bTopMost)
 {
  AfxGetMainWnd()->SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE);
  m_bTopMost=true;
 }
 else
 {
  AfxGetMainWnd()->SetWindowPos(&CWnd::wndNoTopMost ,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE);
  m_bTopMost=false;
 }
  
 ::WritePrivateProfileString("Settings","bTopMost",m_bTopMost ? "1":"0",".\\Settings.ini"); 

posted on 2006-06-24 06:38  路吾  阅读(965)  评论(0编辑  收藏  举报

导航