Solved

F10 handler

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.

914 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

16 Experts available now in Live!

Get 1:1 Help Now