Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CTopDlgDemoDlg::StayOnTop() const
- {
- CRect rect;
- // get the current window size and position
- GetWindowRect( rect );
- // now change the size, position, and Z order
- // of the window.
- ::SetWindowPos(m_hWnd , // handle to window
- HWND_TOPMOST, // placement-order handle
- rect.left, // horizontal position
- rect.top, // vertical position
- rect.Width(), // width
- rect.Height(), // height
- SWP_SHOWWINDOW // window-positioning options);
- }
- // add a control button and command handler for the button to your dialog.
- // then invoke StayOnTop().
- void CTopDlgDemoDlg::OnBtnClick()
- {
- // make this dialog always on top.
- StayOnTop();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement