Problems! Problems!
Here is code for SUB with CALLBACK, that is supposed to work with
hot key, but does nothing unless click on label???
Here is code for SUB with CALLBACK, that is supposed to work with
hot key, but does nothing unless click on label???
Code:
SUB TEST1 DIALOG NEW 0, "Label Hot Key", , , 81, 60, 0 TO hDlg52 IF ERR OR hDlg52 = 0 THEN EXIT SUB ' An Error occurred CONTROL ADD LABEL, hDlg52, %ID_MENU_HELP, "&Help", 1, 5, 80, 14, _ %SS_NOTIFY OR %BS_LEFT OR %BS_VCENTER OR %WS_TABSTOP, 0 CONTROL ADD LINE, hDlg52, 1, "", 1, 16, 80, 1, %SS_BLACKFRAME, 0 CONTROL ADD LABEL, hDlg52, %ID_MENU_ABOUT, "&About", 1, 18, 80, 14, _ %SS_NOTIFY OR %BS_LEFT OR %BS_VCENTER OR %WS_TABSTOP, 0 CONTROL SET COLOR hDlg52, %ID_MENU_HELP, %RED, -1 DIALOG SHOW MODAL hDlg52, CALL TEST1CALLBACK ' Close hDlg52 DIALOG END hDlg52 END SUB CALLBACK FUNCTION TEST1CALLBACK LOCAL yResult AS LONG LOCAL sSubject AS STRING SELECT CASE CBMSG CASE %WM_INITDIALOG ' <- sent right before the dialog is dis CASE %WM_COMMAND ' <- a control is calling SELECT CASE CBCTL ' <- look at control's id CASE %ID_MENU_HELP ' 204 IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = %STN_DBLCLK THEN HFlg = 1 DIALOG END CBHNDL, 1 END IF CASE %ID_MENU_ABOUT ' 205 CALL HABOUT DIALOG END CBHNDL, 1 END SELECT END SELECT END FUNCTION ' TEST1CALLBACK
Comment