2 out of 4 rated this helpful - Rate this topic

WM_MOVING message

Applies to: desktop apps only

Sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.

A window receives this message through its WindowProc function.

#define WM_MOVING                       0x0216

Parameters

wParam

This parameter is not used.

lParam

A pointer to a RECT structure with the current position of the window, in screen coordinates. To change the position of the drag rectangle, an application must change the members of this structure.

Return value

Type: LRESULT

An application should return TRUE if it processes this message.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
WM_MOVE
WM_SIZING
Conceptual
Windows
Other Resources
RECT

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Causing the MOVESIZE loop to exit
The only way to do this is to call ReleaseCapture.
wParam is not always 'not used'.
In my case, dragging a child button (literally, the button, not a copy/image/etc), makes wParam contain the same information as WM_SIZING has in wParam.

As stated (and slightly modified) in the WM_SIZING documentation:

'The edge of the window that is being sized [read: moved].'

The contents translate to the same WMSZ_* enumeration as WM_SIZING. It allows you to get and set the 'detection point' for overlapping another window for example (dragging left? wParam checks left and bottom, dragging right? wParam checks top and right, or any other sort of combo like that).


The WMSZ_* enumeration is treated as flags, e.g, a wParam value of '9' is possible, translating back to WMSZ_LEFT and WMSZ_BOTTOMRIGHT. This way it is more returning an 'area' than a 'location'. Not sure if this is any different with WM_SIZING.


Oh, also, this was observed under Windows 7.

Return value
Return value is missing from the article. If message is processed by application, return what?
Value
WM_MOVING = &H216