Sign in to follow this  
Followers 0
althurm

Receiving Windows messages

5 posts in this topic

Hello All,

I have a stand alone app running. I need to find any functions that will let me receive ANY windows message from the app while it is running. They can be regular messages, error codes, API, whatever. Just trying to get a starting point. Please Help.

Share this post


Link to post
Share on other sites



_WinAPI_SetWindowsHookEx()

Share this post


Link to post
Share on other sites

_WinAPI_SetWindowsHookEx()

This looks like it may be what i need. problem is I only have the running process to work with. (its called bench.exe). I'm thinking i would use $WH_MSGFILTER as the idhook. I'm lost as to what to use for the last 3 parameters of the function.

2nd parameter want a pointer to the hook procedure. How do I get that?

3rd parameter Im guessing I would use NULL

4th parameter - the thread How can I figure out the identifier of the thread? (remember I only know the name of the executable that is running)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You dont have much idea about WndowsMessages, also about the hooks, i was trying to do this a few months ago, maybe you have more lucky and you do it well...

First of all you have an example of this in the help file, take it as reference., there you will get how to get those parameters.

Also READ very well about this function in the help file and in MSDN... you SHOULD use _WinAPI_CallNextHookEx() this function in your hook procedure, you can cause unexpected behavior to your OS if you don´t. also remember to use _WinAPI_UnhookWindowsHookEx() when you finish with your hook.

EDIT: Also maybe you should check the SPY++ tool that comes with any intalation of Visual Studio it have that feature to "spy" Windows Messages, I was reading about this issue and it seems more difficult that i expected. maybe i was wrong.

Edited by monoscout999

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