|
-
April 29th, 2004, 10:27 AM
#1
How to detect F1 keydown
Hi, i have a dialog which is inside a tab control. The tab control is inside CFormView.
How can i detect 'F1' key down regardless of where my focus is?
I could detect it without the tab control inside my form view using PreTranslateMessage of CView to detect the 'F1' but with tab control added, it doesn't works anymore.
Anyone has any idea?? Thanks......
0 error(s), 0 warning(s)
-
April 29th, 2004, 10:34 AM
#2
Regardless of focus you need to use a keyboard hook. If you want to hook only with-in your application this can be done in an a function. If you want to hook system-wide you must implement it in a DLL.
-
April 29th, 2004, 10:43 AM
#3
F1 ---> WM_HELP
Handle WM_HELP in main application window.
Note that, in ClassWizard messages list, it is renamed as WM_HELPINFO.
-
April 29th, 2004, 10:59 AM
#4
mwilliamson : what do you mean by keyboard hook?? any example?
ovidiucucu : that message is only for F1 to F12 key? or any key? Is it same as PreTranslateMessage??
Thanks.
0 error(s), 0 warning(s)
-
April 29th, 2004, 11:17 AM
#5
Originally posted by ayumi
ovidiucucu : that message is only for F1 to F12 key? or any key? Is it same as PreTranslateMessage??
 Thanks.
Only for F1.
Not the same, PreTranslateMessage is not a message but a virtual function.
-
April 29th, 2004, 11:28 AM
#6
Re: How to detect F1 keydown
Originally posted by ayumi
Hi, i have a dialog which is inside a tab control. The tab control is inside CFormView.
How can i detect 'F1' key down regardless of where my focus is?
I could detect it without the tab control inside my form view using PreTranslateMessage of CView to detect the 'F1' but with tab control added, it doesn't works anymore.
Anyone has any idea?? Thanks......
PreTranslateMessage in your app class ought to do it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|