In my windows form app I added a MessageFilter and try to handle all the key strokes by capturing PreFilterMessage method's WindowsMessages.WM_KEYDOWN message. The strange thing is that it seems work fine for all the keys except for one, the F10 key. Bellow is the code for implementing the PreFilterMessage method:
...
public bool PreFilterMessage(ref Message objMessage){
if (objMessage.Msg == Convert.ToInt32(WindowsMessages.WM_KEYDOWN)){
// My key handling logic
}
}
When the code gets executed, all other key strokes, except F10 key, get trapped and the control fall through the "My key handling logic". The F10 key, however, the key stroke seems never get noticed - actually, I checked it in debug mode and found that if statement never get hit when F10 is pressed.
What's going on here