I want to write a program that listens for a window action (creates a window or closes a window) and when a window is created i get new window handle in an HWND array and remove it when i close the window.
By now i'm able to retrieve the main window handle and i guess i have to use the GetMessage() function, something like this;
I'm referring to a window from another application, i read what i could find on codeguru yesterday and i understand that i have to make it with hooks, which right now look kind of complicated. I understood a bit of how they work, but they are still pretty blurry. Actually my software is intended to click on a button when it appears on some specific windows so i guess that if i find the message that the window sends when the button appears i could intercept this message with a hook and click on the button in the window although it's in background ( i made the function for clicks with PostMessage and it works).
Do you have any suggestions ? Is this possible ?
thank you
i played around with Spy++ over the window that i have to post the click to an i filtered the messages and i came up with this:
00031084 P message: 0x0118 [Unknown] wParam:0000FFF8 lParam:97B03836
after this message has appeared for 4 times in a row, i have to click on the button.
is there any way i can use this ?
Not with GetMessage. GetMessage is intended to process messages from the message queue belonging to current thread. So, in your case there's nothing left but hooks.
yes, i posted that before i found out about hooks ...
so for that type of message, what hook procedure could be used ?
the message is : 00031084 P message: 0x0118 [Unknown] wParam:0000FFF8 lParam:97B03836
i'm thinking WH_CALLWNDPROC ... maybe you could direct me to some examples with the exact hook i need ... because all i found is about keyboard hooking
yes, i posted that before i found out about hooks ...
so for that type of message, what hook procedure could be used ?
the message is : 00031084 P message: 0x0118 [Unknown] wParam:0000FFF8 lParam:97B03836
i'm thinking WH_CALLWNDPROC ... maybe you could direct me to some examples with the exact hook i need ... because all i found is about keyboard hooking
Bookmarks