AutoHotkey Community

It is currently May 27th, 2012, 3:45 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: July 29th, 2010, 5:00 pm 
Offline

Joined: November 20th, 2008, 6:00 pm
Posts: 72
Location: Thionville, France
Hi,
I have a script monitoring WM_KEYDOWN events, and I would like to discard the message so that no key is actually sent to the window (under certain conditions).
It's likely that I may also have to monitor and discard WM_KEYUP events.
Does anyone know of a way to do this?
Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2010, 6:53 pm 
Offline

Joined: February 1st, 2010, 2:50 pm
Posts: 237
Location: Netherlands
Don't know if this help but from the help of OnMessage:
What the Function Should Return
For example, a function monitoring WM_LBUTTONDOWN (0x201) may return an integer to prevent the target window from being notified that a mouse click has occurred. In many cases (such as a message arriving via PostMessage), it does not matter which integer is returned; but if in doubt, 0 is usually safest.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2010, 8:03 pm 
Offline

Joined: November 20th, 2008, 6:00 pm
Posts: 72
Location: Thionville, France
From MSDN info for WM_KEYDOWN message,
Quote:
An application should return zero if it processes this message.
I did try to return 1 instead of 0 already, but noticed that it only worked for certain keys (WM_CHAR messages are not generated any more) but kept sending others like win keys or mute key.
I used Winspector Spy and was able to notice that some keys (volume_mute, media_next, media_prev, ...) sent a WM_APPCOMMAND message. Discarding this message prevented the key strokes.

As for win keys, it seems I will have to find some workaround, as I could not find a message to discard.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], bobbysoon and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group