Skip to content

WindowsApi:SetWindowPos

Window TopMost

// 최상위 윈도우로 설정하여 강제로 앞으로 나오게 한다. 
::SetWindowPos(m_pMainWnd->m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, 
                                          SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW); 
// 최상위 윈도우 속성을 제거한다. 하지만 윈도우는 다른 윈도우보다 앞에 존재한다. 
::SetWindowPos(m_pMainWnd->m_hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, 
                                          SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW); 

BringWindowToTop()를 사용하는 방법은 이 곳을 참조.

See also