Good morning,
I have a problem with the command accelerator of menu. In the little example below, the Alt-T hot-key don't works and I'm not able to understand were I'm wrong.
Any suggestions?
Thanks
Sergio
I have a problem with the command accelerator of menu. In the little example below, the Alt-T hot-key don't works and I'm not able to understand were I'm wrong.
Code:
#COMPILE EXE #DIM ALL #INCLUDE "win32api.inc" %ID_ITEM1 = 401 %ID_ITEM2 = 402 CALLBACK FUNCTION DlgProc () AS LONG SELECT CASE CBMSG CASE %WM_COMMAND SELECT CASE CBCTL CASE %IDCANCEL IF CBCTLMSG = %BN_CLICKED THEN DIALOG END CBHNDL END IF CASE %ID_ITEM1 MSGBOX "Menu item 1" CASE %ID_ITEM2 MSGBOX "Menu item 2" END SELECT END SELECT END FUNCTION FUNCTION PBMAIN () AS LONG LOCAL hDlg AS DWORD LOCAL Result AS LONG LOCAL hMenu AS DWORD LOCAL hPopup AS DWORD LOCAL dlgStyle AS LONG dlgStyle = %DS_CENTER OR %WS_CAPTION OR %WS_SYSMENU DIALOG NEW 0, "Menu test", , , 400, 300, dlgStyle, 0 TO hDlg MENU NEW BAR TO hMenu MENU NEW POPUP TO hPopup MENU ADD POPUP, hMenu, "&Title", hPopup, %MF_ENABLED MENU ADD STRING, hPopup, "&Item1", %ID_ITEM1, %MF_ENABLED MENU ADD STRING, hPopup, "I&tem2", %ID_ITEM2, %MF_ENABLED MENU ATTACH hMenu, hDlg DIALOG SHOW MODAL hDlg, CALL DlgProc TO Result END FUNCTION
Thanks
Sergio
Comment