Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

F10 handler

Posted on 1998-01-20
5
Medium Priority
?
690 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

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…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

688 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