Is there a particular reason why you are not using a control callback here?
I am a bit confused as to what you are trying to accomplish with this approach.
Determining the event type is simple. The return value for GetUserEvent will be one of the following things:
0 No event.
1 Commit event occurred.
1,000-10,000 Event queued by QueueUserEvent.
Negative values indicate that an error occurred.
Remember that when you press a key, you may get several event notifications for each key stroke. These can include EVENT_VAL_CHANGED and EVENT_COMMIT in addition to EVENT_KEYPRESS
If you get an EVENT_KEYPRESS message, you should be able to use the following functions to determine what the key was:
GetKeyPressEventVirtualKey()
GetKeyPressEventCharacter()
GetKeyPressEventModifiers()
Martin Fredrickson
Test Engineer
Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128