[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Hot keys in MSVC++6.0

Ok.  I's using MSVC++6 and I have developed a dialog based application (via AppWizard).  On one of my dialogs, I want to enable it so that I can press F6, and it will perform and action (e.g. popup another dialog, save registry settings, etc.)  How do I do this?  Thanks!
0
mgonyea
Asked:
mgonyea
  • 2
  • 2
1 Solution
 
SteveGTRCommented:
Override the PreTranslateMessage() and insert the following code to trap the F6 key:

if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_F6)
  ; // Do what you want to do

Good Luck,
Steve
0
 
mgonyeaAuthor Commented:
Where is the PreTranslateMessage function?  Is there a WM_<EVENT> associated with it?

Thanks
0
 
mgonyeaAuthor Commented:
Oh I got it!  Sorry about that.  Wasn't thinking...probably too much drug and alcohol abuse or something... ;-)

Thanks again!
0
 
ioni87Commented:
Hey, ummm im trying to do something simular, but with the scroll lock key, and numbers combination. Using visual .net

I have a dialog box with two buttons, when i click the left one, its supposed to perform the key combo ect... but i must use the scroll lock key, and it doesnt have an ascii code or anything :(

If you could help at all, that would be great.
0
 
SteveGTRCommented:
Open up a new question... no biggy-backing :)
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now