Sign in to follow this  
Followers 0
LostUser

How to intercept WM_USER messages?

6 posts in this topic

I was initially trying to get the changing text from a control. Which I finally figured out how to do.

However, I talked to the person who wrote the program and they said if I can intercept WM_USER messages, then I can get the data I need and it is updated faster than looking at the control.

Anyone know how to do this or how to get the information to do this? I am currently scouring the internet but have nothing usable yet.


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites



GUIRegisterMsg() ?

This may be out of my league but I am going to try anyway.

So how do I get the message ID from the program?


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites

When you move this gui, MyFunction will be called. Just change $WM_MOVING to $WM_USER

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$GUI = GUICreate("bla",100,100)
GUISetState()


$WM_MOVING = 0x0216

GUIRegisterMsg($WM_MOVING,"Myfunction")

While 1
    
WEnd

Func Myfunction($hWnd, $iMsg, $wParam, $lParam)
    
    MsgBox(0,"bla","bla")
    
EndFunc

Share this post


Link to post
Share on other sites

When you move this gui, MyFunction will be called. Just change $WM_MOVING to $WM_USER

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$GUI = GUICreate("bla",100,100)
GUISetState()


$WM_MOVING = 0x0216

GUIRegisterMsg($WM_MOVING,"Myfunction")

While 1
    
WEnd

Func Myfunction($hWnd, $iMsg, $wParam, $lParam)
    
    MsgBox(0,"bla","bla")
    
EndFunc

I tried this and it works until I change $WM_MOVING to $WM_USER, then I get an error.

I think I understand what you are trying to show after I have read up on the WM_USER information. I need to learn more about these types of things.

I just found, however, that the program I am trying to access does not use $WM_USER for the battery data. It is used to send memory pointer information to his battery program while running in memory.

Also, while his program does show multiple batteries, it doesn't show multiple batteries in the Static object I was reading so now that's out too.

I am looking at this program but it doesn't seem to work quite right or I am missing something.

Thanks for your help though.


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

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