Solved

F10 handler

Posted on 1998-01-20
5
665 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 170 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now