Author |
Message |
hellzlakerrrrr Guest
Offline
|
Posted: Sat Apr 19, 2008 12:37 am Post maybe stupid Post subject: how to create a hotkey in c++ |
 |
|
|
|
i searched rohitab cplus plus google all kinds of shit and could not find anything on how to create a hotkey for you program in c++ like how to make something that when you press CTRL+A a message box pops up and says hello? |
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sat Apr 19, 2008 1:19 am Post maybe stupid Post subject: |
 |
|
|
|
You need a form first
Once you get the form, you should be able to have a 'keypress' event from it.
I'm really not sure how this works in c++... never used forms with it _________________ (Insert a bunch of dead links here) |
|
Back to top |
|
 |
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: Sat Apr 19, 2008 9:03 am Post maybe stupid Post subject: |
 |
|
|
|
thanks allot, i really didn't were to even start searching and on google lots of BS came up |
|
Back to top |
|
 |
Doc Flabby (not logged in Guest
Offline
|
|
Back to top |
|
 |
Samapico No, these DO NOT look like penises, ok?

Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sat Apr 19, 2008 10:47 am Post maybe stupid Post subject: |
 |
|
|
|
I think he meant a shortcut to a menu item...
hmm... now that I think of it, if you can find a menu control, the menu items might have a shortcut property (like you can set up Ctrl+S for a 'save' item) |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sun Apr 20, 2008 4:55 pm Post maybe stupid Post subject: |
 |
|
|
|
You could listen to keyboard events and then do something when specific ones happen _________________
 |
|
Back to top |
|
 |
Cheese Wow Cheese is so helpful!

Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Sat Apr 26, 2008 1:01 am Post maybe stupid Post subject: |
 |
|
|
|
i know how to code a hotkey in win32 c++, but only while the window is active...
IF ANYONE CAN FIND OUT HOW TO CODE A GLOBAL HOTKEY, THAT WOULD BE AWESOME. _________________ SSC Distension Owner
SSCU Trench Wars Developer |
|
Back to top |
|
 |
Doc Flabby Server Help Squatter

Joined: Feb 26 2006 Posts: 636 Offline
|
|
Back to top |
|
 |
Cheese Wow Cheese is so helpful!

Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Mon Jun 30, 2008 5:05 pm Post maybe stupid Post subject: |
 |
|
|
|
was reviewing stuff...
never implemented this fully,
i dont like codeproject, where else is there info?
because if i did
RegisterHotKey(hwnd, 101, MOD_ALT, 'H');
case WM_HOTKEY:
{
MessageBox(hwnd,"wm hotkey","wm hotkey",MB_OK | MB_ICONINFORMATION);
if(lParam == 101)
{
MessageBox(hwnd,"wm hotkey","101",MB_OK | MB_ICONINFORMATION);
}
}
break;
|
alt h anywhere would bring up wmhotkey box, but not 101.
-edit-
messed around, found that wparam controls it, so nvm
proper code:
RegisterHotKey(hwnd, 101, MOD_ALT, 'H');
RegisterHotKey(hwnd, 102, MOD_ALT, 'J');
...
case WM_HOTKEY:
{
if(wParam == 101)
{
MessageBox(hwnd,"101 W","wm hotkey",MB_OK | MB_ICONINFORMATION);
}
if(wParam == 102)
{
MessageBox(hwnd,"102 W","wm hotkey",MB_OK | MB_ICONINFORMATION);
}
}
break;
|
cheese's win32 to do list:
create working progress bar
use winxp styles instead of win95 look
parse/replay mp3/wav/aac file
parse black bmp for white pixels
set up simple client and server applications able to specify ip/port
any help on any of these would be appreciated |
|
Back to top |
|
 |
|