Discussion:
MoveWindow/SetWindowPos not working in OnInitDialog
(too old to reply)
CheshireCat
2004-03-05 16:11:02 UTC
Permalink
I'm using Microsoft Embedded Visual C++ version 3 to program a windows ce
H/PC Pro 2.11 device.
As it says in the subject, neither is working in the OnInitDialog function.
In resource editor all values (including centre) are unchecked and default
x,y values are both set to zero.
Ive read another thread on google that talks about an "absolute align"
property, but this doesn't exist in my version of MEVC class property
editor.
If I call the functions later from a button click the window will leap to
the correct position.
Can I fix this please
unknown
2004-03-05 17:29:33 UTC
Permalink
I don't have particular experience with this, but it could be that, once you
return from OnInitDialog, the window position is reset by the dialog class.

I would first verify the calls MoveWindow/SetWindowPos are actually working
(test the return value and call GetWindowRect to verify the coordinates are
as expected).

Assuming the calls work, then it is the dialog class setting the position
when you return from OnInitDialog(). One workaround would be to have your
OnInitDialog post a WM_USER message that your class would handle by calling
MoveWindow/SetWindowPos. The handler would be called after the dialog was
created and initialized, so you might see it in once place, and then
suddenly moved once your handler is called. If that happens, you may need
to use modeless dialog, in which you can have the window hidden until you
can get to the handler which would do the MoveWindow/SetWindowPos, as well
as ShowWindow().
--
Have an opinion on the effectiveness of Microsoft Embedded newsgroups? Tell
Microsoft!
https://www.windowsembeddedeval.com/community/newsgroups


Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
Post by CheshireCat
I'm using Microsoft Embedded Visual C++ version 3 to program a windows ce
H/PC Pro 2.11 device.
As it says in the subject, neither is working in the OnInitDialog function.
In resource editor all values (including centre) are unchecked and default
x,y values are both set to zero.
Ive read another thread on google that talks about an "absolute align"
property, but this doesn't exist in my version of MEVC class property
editor.
If I call the functions later from a button click the window will leap to
the correct position.
Can I fix this please
CheshireCat
2004-03-06 12:38:16 UTC
Permalink
Thanks Michael. Posting a message fudges it.

Loading...