Actually, this doesn't work. After it returns from OnInitDialog, the dialog is forced to
center-screen. The trick is to PostMessage a user-defined message, and in its handler, do
the SetWindowPos.
You might consider being multi-monitor aware as well. You need to get the rectangle of
the screen of the active monitor, then do a GetWindowRect() of your dialog.
CRect monitor;
...get monitor coordinates
CRect w;
GetWindowRect(&w);
SetWindowPos(NULL, monitor.right - w.Width(), monitor.bottom - w.Height(), 0, 0,
SWP_NOSIZE | SWP_NOZORDER);
for a single monitor system, you can use ::GetSystemMetrics, e.g.,
CRect monitor(0, 0, ::GetSystemMetrics(SM_CXSCREEN), ::GetSystemMetrics(SM_CYSCREEN));
joe
Post by AliR (VC++ MVP)In the OnInitDialog method of the dialog use SetWindowPos to move it.
AliR.
Post by RANHi,
How do i show my modal login CDialog on the right bottom of the
screen ?
If i do DoModal() its in the center of the screen.
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm