Sign in to follow this  
Followers 0
twiz911

How to send WM_USER to a window

2 posts in this topic

Hi

Using Winspector and clicking on a graphical button within an app I see the following commands (filtering out WM_MOUSEMOVE, WM_NCHITTEST, WM_SETCURSOR):

WM_SETFOCUS

WM_ACTIVATE

WM_LBUTTONDOWN

WM_PAINT

WM_LBUTTONUP

WM_USER + 9977 (0x00002af9)

WM_NCACTIVATE

....

From my reading, I understand that WM_USER is an internal message so am I correct in thinking sending that message to the window should click the button?

If so can someone please tell me how, or ideally, provide sample code that would do that?

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Seems like a dicey way to do it. For one thing if the developer adds some messages all the numbering may change. C guys have a tendency to do stuff like

#define MY_MSG (WM_USER + 1)

#define MY_NEW_MSG (MY_MSG + 1)

...

you see the peril. If the programmer sticks a new msg in the middle the numbering changes from that point on.

Why do you need to poke into a program private msg? If there is a button can't you just send it a click?

Edited by MilesAhead

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0