比方说,在资源管理器,任选中一个文件,右键单击,会弹出一个菜单.
我听一位大佬说这个菜单是系统定制的,
我想问的是,怎么样才能调用这个菜单呢?
可能是MSDN版本的原因,找了很久也没有找到.

解决方案 »

  1.   

    The TrackPopupMenu function displays a shortcut menu at the specified location and tracks the selection of items on the menu. The shortcut menu can appear anywhere on the screen.BOOL TrackPopupMenu(
      HMENU hMenu,         // handle to shortcut menu
      UINT uFlags,         // screen-position and mouse-button flags
      int x,               // horizontal position, in screen coordinates
      int y,               // vertical position, in screen coordinates
      int nReserved,       // reserved, must be zero
      HWND hWnd,           // handle to owner window
      CONST RECT *prcRect  // ignored
    );
     
      

  2.   

    CDialog::OnRButtonUp(nFlags, point);
    GetCursorPos(&point);
    CMenu menu;
    VERIFY( menu.LoadMenu( IDR_MENU1 ) );
    CMenu* popup = menu.GetSubMenu(0);
    ASSERT( popup != NULL );
    popup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this ); 
    // IDR_MENU1 为在工作区resource中自己做的一个菜单,