Click to See Complete Forum and Search --> : Activate Dialog without menu option
Will Rothwell
May 18th, 1999, 08:49 AM
Hi,
I want to let certain users (administrators) to activate a 'secret' dialog without the menu option being shown on the main menu. Something like pressing <Ctrl-E-L> will bring up the dialog box, just like a normal working selection. I know it has something to do with string table but I have no idea how it works.
Can anyone help please.
Will
BrianOG
May 18th, 1999, 09:43 AM
Not certain about this but it should work.....
In the resource view (on the LHS of VC) right click on "MyApp resources" and choose "Resource Symbols..."
In here add a new resource symbol (ID_SECRETDLG or whatever) and assign it a value.
In you view/doc/mainframe/whereever class, add a command handler (copy and modify an existing menu handler etc).
Add line to the message map (near top of cpp file) add a line that maps your new ID to the new command handler (copy and modify an existing menu handler).
In the resource view, open the accelerator table and assign an accelerator to your new ID.
Run program, and hit accel key.
If it dont work, sacrifice a chicken to the keyboard god, and try again.... (only jOOOking)
Will Rothwell
May 19th, 1999, 01:01 AM
I cooked it exactly according to your recipe and it smells good. It certainly works. Great. Now, is it possible to give it a little bit of spice. Calling the dialog from Ctrl+E or Ctrl+Alt+E etc. is no problem, but can we have Ctrl+E+1+3+5 or something similar ??
Will
Dan Haddix
May 19th, 1999, 01:38 AM
The standard resource editor does not support multiple key accelerators. If you want this behavor your going to have to overload the OnKeyDown function, and test for the key combination yourself.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.