Connecting Tech Pros Worldwide Forums | Help | Site Map

Ctrl+S = save

Familiar Sight
 
Join Date: Apr 2007
Posts: 137
#1: Oct 27 '07
in my program, i wanted to make it so when i press ctrl and s at the same time, my program would run the save function.
its obviously c++ and im using Dev-C++ Bloodshed (with MinGW)

thanks in advance

Moderator
 
Join Date: Mar 2007
Location: North Bend Washington USA
Posts: 5,370
#2: Oct 28 '07

re: Ctrl+S = save


Just check for a character of 19.
Familiar Sight
 
Join Date: Apr 2007
Posts: 137
#3: Oct 28 '07

re: Ctrl+S = save


Quote:

Originally Posted by weaknessforcats

Just check for a character of 19.

i dont understand how to do that, i imagine whatever i do, it goes in the form procedure and would looks somthing like

if(message==19){stuff}

could you tell me more?
Member
 
Join Date: Sep 2007
Posts: 90
#4: Oct 28 '07

re: Ctrl+S = save


Quote:

Originally Posted by lumpybanana247

i dont understand how to do that, i imagine whatever i do, it goes in the form procedure and would looks somthing like

if(message==19){stuff}

could you tell me more?

If you are programming a Win32 application, you need an Accelerator.
Familiar Sight
 
Join Date: Apr 2007
Posts: 137
#5: Oct 29 '07

re: Ctrl+S = save


Quote:

Originally Posted by Cucumber

If you are programming a Win32 application, you need an Accelerator.

yeah, I'm using Win32.

I have looked up accelerators for quite a while and none of them seem to work. :-( can somebody give me an example of what they used that worked please?
Member
 
Join Date: Sep 2007
Posts: 90
#6: Oct 31 '07

re: Ctrl+S = save


Quote:

Originally Posted by lumpybanana247

yeah, I'm using Win32.

I have looked up accelerators for quite a while and none of them seem to work. :-( can somebody give me an example of what they used that worked please?

Try the following APIs

LoadAccelerators()
TranslateAccelerator()

And you need a resources file like this
Expand|Select|Wrap|Line Numbers
  1. MyAccel ACCELERATORS
  2. {
  3.    "^S", 100
  4. }
  5.  
Reply