Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

F10 handler

Posted on 1998-01-20
5
Medium Priority
?
696 Views
Last Modified: 2013-12-03
I am inserting user-defined hotkeys in my application. I do it by handling WM_KEYDOWN and WM_SYSKEYDOWN in message loop. But. I got stupid problem - i cant handle F10 button. Where is  no  WM_KEYDOWN message when i pressing F10. Any ideas, how to dispatch this button ?

0
Comment
Question by:jaba
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1410173
Override PreTranslateMessage for application class and check when pMsg->message == WM_KEYDOWN && pMsg->wParam = VK_F10
0
 
LVL 3

Author Comment

by:jaba
ID: 1410174
It working for all other keys, but F10. Look for messages, coming to window by Spy++. There are no any WM_KEYDOWN messages after you pressing F10. When you RELEASE this button, WM_SYSCOMMAND (SC_KEYMENU) WM_INITMENU etc appear. I need to dispatch F10 when it jast pressed.

0
 
LVL 7

Accepted Solution

by:
galkin earned 680 total points
ID: 1410175
Yes you are right. I checked with Spy, when I press F10 WM_SYSCOMMAND is sent to main window. First I don't understand why you cannot handle WM_SYSCOMMAND with F10. I also found that mwindow that has focus is sent two messages WM_SYSKEYDOWN and when you release F10 key WM_SYSKEYUP, so you can trap these messages for that window.
0
 

Expert Comment

by:cyhrjocyh
ID: 1410176
Hi,

Add the handler for WM_GETDLGCODE.
And write the below code to handler,

   return DLGC_WANTALLKEYS;

I hope it will be perfectly satisfying you.


0
 
LVL 3

Author Comment

by:jaba
ID: 1410177
HEh. Really. FOCUSED window getting WM_SYSKEYDOWN ! I trapping it in MAIN window of application. IS was my fault. Good answer. Thanks.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question