Compartilhar via


How to Obtain a Handle to a Soft Key Menu

Windows Mobile SupportedWindows Embedded CE Not Supported

9/9/2008

Conforme o seguinte procedimento, você pode usar uma das duas mensagens interface do usuário para obter um identificador para um menu chave flexível.

Para obter um identificador para um menu chave flexível

  1. Use a mensagem SHCMBM_GETSUBMENU. No seguinte exemplo, um identificador para o menu associado com o direito chave flexível é retornado.

    // IDM_CARDVIEW_SK2_MENU is the soft key's resource ID.
    hmenu = (HMENU)SendMessage(hwndMenuBar, SHCMBM_GETSUBMENU, 0, IDM_CARDVIEW_SK2_MENU);
    
  2. Use a mensagem Windows Embedded CE WM_INITMENUPOPUP, que é enviada quando um menu está prestes a ser exibido.

Um identificador para o chave flexível menu pode ser obtido enviando-o da barra SHCMBM_GETMENU mensagem. No seguinte exemplo, um identificador para o IDR_MAIN_MENU menu será retornado.

HMENU hmenu = (HMENU)SendMessage(hwndMenuBar, SHCMBM_GETMENU, 0, 0);

See Also

Tasks

How to Create a Soft Key Bar

Other Resources

Soft Key and Menu Guidelines