Move Window
-
Hello I want to Create a modaless dialog that user can't move it how can i do it? thanks. Agh
-
Hello I want to Create a modaless dialog that user can't move it how can i do it? thanks. Agh
Add a CRect member to your dialog class and handle the WM_MOVE and WM_MOVING messages. In the WM_MOVE message handler call GetWindowRect() to get the position of the dialog, save it in the CRect member. In the WM_MOVING handler, set the values of the supplied CRect pointer to those in the saved CRect.
void CMyDialog::OnMove(int x, int y)
{
CDialog::OnMove(x, y);
GetWindowRect(m_Rect);
}void CMyDialog::OnMoving(UINT fwSide, LPRECT pRect)
{
*pRect = m_Rect;
}The method given above will only work if the user tries to move the dialog with the mouse, it will break when the user uses the Move command in the context menu.
You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!
-
Hello I want to Create a modaless dialog that user can't move it how can i do it? thanks. Agh