INF: Dialog Box Placement

ID Number: Q35643

2.03 2.10 3.00

WINDOWS

Summary:

Adding the following code to the dialog-box routine will move the side

of the dialog box to be flush with the left side of the screen. This

code will move the dialog box before it is displayed.

RECT r;

case WM_INITDIALOG:

GetWindowRect(hDlg,&r);

MoveWindow (hDlg, 0,r.top,r.right-r.left,r.bottom-r.top , TRUE);

break;

GetWindowRect() will get the current size of the window and the

MoveWindow() call will move the window to the left of the screen. As a

result, the dialog box will be at the same Y position at which it was

originally located.