--- In [email protected], Thomas Hruska <thru...@...> wrote:
>
> wy737 wrote:
> > Hi, friend.
> > Any one know how to create menu shortcut in vc++ ?
> >
> > I used accelerator like below:
> >
> > IDR_MAINFRAME ACCELERATORS
> > BEGIN
> > "X", ID_FILE_EXIT, VIRTKEY, CONTROL
> > END
> >
> > and add some for my menu like this:
> > "E&eit\tCtrl + x"
> >
> > but doesn't work, even doesn't display underline ?
> > How come ? some things wrong ? help please!
>
> Well any number of things could be wrong. The accelerator isn't being
> translated is the most likely cause. The underline issue could be the
> OS configuration (i.e. there is a global option to turn on underlines in
> menus). Your menu has to have the same ID as the accelerator to handle
> it correctly. Ctrl+X may have other meanings and could be getting
> trapped by a standard UI component.
>
> BTW, Ctrl+X is typically "Cut" (for 'cut-and-paste' operations) and
> Alt+F4 or Ctrl+F4 are generally exit and close respectively. You should
> stick to standard behavior. Hijacking Ctrl+X is going to be weird for
> most people.
>
> --
> Thomas Hruska
> CubicleSoft President
> Ph: 517-803-4197
>
> *NEW* MyTaskFocus 1.1
> Get on task. Stay on task.
>
> http://www.CubicleSoft.com/MyTaskFocus/
>
Thomas,
Thanks, I learn some thing today.
But I only create two menus:
IDR_MENU MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit\tCtl+x", ID_FILE_EXIT
END
POPUP "&Test"
BEGIN
MENUITEM "&Input", ID_TEST_INPUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_ACCELERATOR ACCELERATORS DISCARDABLE
BEGIN
"I", ID_TEST_INPUT, VIRTKEY, CONTROL
END
I use VC++ 6.0.
I don't understand why doesn't work and even doesn't show underline ?
could you help me !