tags:

views:

13

answers:

1

Hi I m generating some keyboard events on my application using keybd_event(). But I want to check that my application actually got my previous KEYDOWN and KEYUP before i do next set of keydown and keyup (for synchrnization ) Is there any api that will let me know that the my application has actually recieved /processed the event.

thanks and advance

A: 

Hook the wndproc of the app using SetWindowLongPtr and check the incoming messages then pass them on to the origional wndproc, this is pretty messay though, but its probably the only non-'black magic' way

Necrolis
Thanks for the suggestion Necrolis.. I tried this .. but I used SetWindowsHookEx for WH_GETMESSAGE , and I see that the application is getting this event (the characters prints there) but I still dont get that notification.. and some times neither my hook gets it nor the application..
Prakash
If your targeting a specific windows based application, it might be better to use SendMessage( http://msdn.microsoft.com/en-us/library/ms644950(VS.85).aspx ), see if that solves anything. also try monitoring the actual WNDProc with WH_CALLWNDPROC if you are still using SetWindowHookEx(you can double check the results using Spy++)
Necrolis
Strangely , when I use spy++ to monitory keyboard messages .. i dont see any message when i do things like "Alt+F" on this window.
Prakash
Could that be the reason why even my window hook is not recieving the events? I am not sure why spy++ or my hook (i.e SetWindowHookEx for WH_GETMESSAGE) is not able to get events/messages when I do any keyboard action with application window.
Prakash