Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

message WM_WindowPosChanging

221 views
Skip to first unread message

jaime cañas

unread,
Oct 26, 1998, 3:00:00 AM10/26/98
to
I have a procedure to handle the message WM_WindowPosChanging in the
declaration of one form:.

"procedure WMWindowPosChanging( var mensaje:
TWMWindowPosChanging); message WM_WindoqwPosChanging;"

but this procedure not only capture the message for the form, capture
the message
WM_WindoqwPosChanging for all the other forms, if i move other window
diferent of the message handle, the program continue the execution in
this procedure.

This not succeed if i change the message for WM_WindoqwPosChanged.

why happen this?

Jaime A Cañas
jca...@asobancaria.com


jaime cañas

unread,
Oct 26, 1998, 3:00:00 AM10/26/98
to
I have a procedure to handle the message WM_WindowPosChanging in the
declaration of one form:.

"procedure WMWindowPosChanging( var mensaje:
TWMWindowPosChanging); message WM_WindoqwPosChanging;"

but this procedure not only capture the message for the form, capture
the message
WM_WindoqwPosChanging for all the other forms, if i move other window
diferent of the message handle, the program continue the execution in
this procedure.

This not succeed if i change the message for WM_WindowPosChanged.

Yorai Aminov (TeamB)

unread,
Oct 27, 1998, 3:00:00 AM10/27/98
to
On Mon, 26 Oct 1998 15:53:34 -0500, jaime cañas
<jca...@asobancaria.com> wrote:

>but this procedure not only capture the message for the form

This is how message handling works in Delphi (and Windows, for that
matter). A window only handles messages sent/posted to itself, not to
other windows.

You can create an event handler for Application.OnMessage. This will
allow you to see all messages posted to all forms.

---
Yorai Aminov (TeamB)
http://ourworld.compuserve.com/homepages/yaminov
(TeamB cannot answer questions received via email.
To contact me for any other reason remove nospam from my address)

R E Shenhar

unread,
Oct 27, 1998, 3:00:00 AM10/27/98
to jaime cañas
Jaime - you are right. This is how Windows processes the
wm_WindowPosChanging - it sends the message to all the windows
(although this behavior is not explained very good in the win32.hlp -
but what can you expect? it's Microsoft).
What you need to do is to check the handle (HWND) in the
WindowPos structure to see which window is moving (remember
that Delphi gives you the handle in Form1.Handle).

Cheers,

R E


jaime cañas wrote:
>
> I have a procedure to handle the message WM_WindowPosChanging in the
> declaration of one form:.
>
> "procedure WMWindowPosChanging( var mensaje:
> TWMWindowPosChanging); message WM_WindoqwPosChanging;"
>
> but this procedure not only capture the message for the form, capture
> the message
> WM_WindoqwPosChanging for all the other forms, if i move other window
> diferent of the message handle, the program continue the execution in
> this procedure.
>

> This not succeed if i change the message for WM_WindoqwPosChanged.

0 new messages