MFC 에서는 CWnd::SetWindowPos , API 에서는 SetWindowPos 함수를 사용

1. MFC 버젼

Always on Top 설정
SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);

Always on Top 해제
SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOSIZE |SWP_NOMOVE);

SWP_NOSIZE, SWP_NOMOVE 는 윈도우의 크기와 이동이 되지 않게끔 하는 플래그

 

2. API 버젼

Always on Top 설정
SetWindowPos(YourHwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);

Always on Top 해제
SetWindowPos(YourHwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);


m_pMainWnd->SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE);

만약 wndTopMost 를 찾을수 없다고 하면

SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOSIZE);

=> SetWindowPos(&(Cwnd::wndTopMost), 0, 0, 0, 0, SWP_NOSIZE); 

'프로그래밍 > C C++' 카테고리의 다른 글

DLLs for Beginners  (0) 2009.05.06
Process Kill with processname  (0) 2009.05.06

+ Recent posts