CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    156

    Activate Dialog without menu option

    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


  2. #2
    Join Date
    May 1999
    Posts
    116

    Re: Activate Dialog without menu option

    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)


  3. #3
    Join Date
    May 1999
    Posts
    156

    Re: Activate Dialog without menu option - a bit of spice more?

    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




  4. #4
    Join Date
    May 1999
    Posts
    82

    Re: Activate Dialog without menu option - a bit of spice more?

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured