要如何使用?

解决方案 »

  1.   

    Declare Function CreateAcceleratorTable Lib "user32" Alias "CreateAcceleratorTableA" (lpaccl As ACCEL, ByVal cEntries As Long) As LongPublic Type ACCEL
            fVirt As Byte
            key As Integer
            cmd As Integer
    End TypefVirt
    Specifies the accelerator behavior. This member can be one or more of the following values. 
    FALT
    The ALT key must be held down when the accelerator key is pressed.
    FCONTROL
    The CTRL key must be held down when the accelerator key is pressed.
    FNOINVERT
    Specifies that no top-level menu item is highlighted when the accelerator is used. If this flag is not specified, a top-level menu item will be highlighted, if possible, when the accelerator is used. This attribute is obsolete and retained only for backward compatibility with resource files designed for 16-bit Windows. 
    FSHIFT
    The SHIFT key must be held down when the accelerator key is pressed.
    FVIRTKEY
    The key member specifies a virtual-key code. If this flag is not specified, key is assumed to specify a character code.
    key
    Specifies the accelerator key. This member can be either a virtual-key code or a character code. 
    cmd
    Specifies the accelerator identifier. This value is placed in the low-order word of the wParam parameter of the WM_COMMAND or WM_SYSCOMMAND message when the accelerator is pressed. 最后调用DestroyAcceleratorTable
      

  2.   

    给你段c++的如何 HACCEL hAccel;
    ACCEL  acAccel[4]; acAccel[0].fVirt = FCONTROL | FVIRTKEY;
    acAccel[0].key   = ( DWORD )VkKeyScan( ( TCHAR )'a' );
    acAccel[0].cmd   = IDM_TEST1;

    acAccel[1].fVirt = FVIRTKEY;
    acAccel[1].key   = ( DWORD )VkKeyScan( ( TCHAR )'b' );
    acAccel[1].cmd   = IDM_TEST2;

    acAccel[2].fVirt = FSHIFT | FVIRTKEY;
    acAccel[2].key   = ( DWORD )VkKeyScan( ( TCHAR )'C' );
    acAccel[2].cmd   = IDM_TEST3;

    acAccel[3].fVirt = FSHIFT | FVIRTKEY;
    acAccel[3].key   = ( DWORD )VkKeyScan( ( TCHAR )'c' );
    acAccel[3].cmd   = IDM_TEST3;

    hAccel = CreateAcceleratorTable( acAccel, 4 );

    while( ( bRet = GetMessage( &msg, NULL, 0, 0 ) ) != 0 ){
    if( bRet == -1 ){
    break;
    }else{
    if( !TranslateAccelerator( hWnd, hAccel, &msg ) ){
    TranslateMessage( &msg );
    DispatchMessage( &msg );
    }
    }
    }

    DestroyAcceleratorTable( hAccel );
    return msg.wParam;
    大概意思              ___
                 (  ">
                  )(
                 // )  [email protected]
              --//""------------
              -/------   
      

  3.   

    谢谢!不过我也搞掂了,可以再帮个忙吗?
    menuhelp又怎样用?我在菜单上移过里状态栏里只显示空白..我实现搞不懂那些参数
    假如我的菜单如下  标题   ID     提示用语
    文件
      打开   1000   打开一个存在的文件
      保存   1001   保存当前文件
      退出   1002   退出本程序