Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
how to create a hotkey in c++

 
Post new topic   Reply to topic Printable version
 View previous topic  1stStrike random comments Post :: Post MGB, your legacy will live on... ...  View next topic  
Author Message
hellzlakerrrrr
Guest


Offline

PostPosted: Sat Apr 19, 2008 12:37 am   Post maybe stupid    Post subject: how to create a hotkey in c++ Reply to topic Reply with quote

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

PostPosted: Sat Apr 19, 2008 1:19 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sat Apr 19, 2008 9:03 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

thanks allot, i really didn't were to even start searching and on google lots of BS came up
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Doc Flabby (not logged in
Guest


Offline

PostPosted: Sat Apr 19, 2008 9:19 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

What do you mean by hotkey? Like using a Windows + Letter combo. Theres a windows API call to set that up.
http://www.codeproject.com/KB/system/nishhotkeys01.aspx
nice example there
Back to top
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Sat Apr 19, 2008 10:47 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Sun Apr 20, 2008 4:55 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

You could listen to keyboard events and then do something when specific ones happen
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Sat Apr 26, 2008 1:01 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Sun Apr 27, 2008 8:27 am   Post maybe stupid    Post subject: Reply to topic Reply with quote

Cheese wrote:
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.


http://www.codeproject.com/KB/system/nishhotkeys01.aspx
I already have, used the info in this link icon_smile.gif
_________________
Rediscover online gaming. Get Subspace | STF The future...prehaps
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1017
Offline

PostPosted: Mon Jun 30, 2008 5:05 pm   Post maybe stupid    Post subject: Reply to topic Reply with quote

was reviewing stuff...
never implemented this fully,
i dont like codeproject, where else is there info?

because if i did
Code: Show/Hide

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:
Code: Show/Hide

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
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Trash Talk All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 16 page(s) served in previous 5 minutes.

phpBB Created this page in 0.611167 seconds : 33 queries executed (87.1%): GZIP compression disabled