Hi all,
The %BN_CLICKED message of a button only takes place when a button
is released.
I would like to trap the event when a button is pressed.
I tried it like this but it does nothing apparently...:
I'm sure when one of you guys comes up with the solution, it will, once
again, seem so obvious...(hopefully)
kind regards
Eddy
------------------
[email protected]
[This message has been edited by Eddy Van Esch (edited June 19, 2001).]
The %BN_CLICKED message of a button only takes place when a button
is released.
Code:
CALLBACK FUNCTION b1 IF CBCTLMSG=%BN_CLICKED THEN MSGBOX "fff" END IF END FUNCTION
I tried it like this but it does nothing apparently...:
I'm sure when one of you guys comes up with the solution, it will, once
again, seem so obvious...(hopefully)

Code:
#COMPILE EXE #DIM ALL #INCLUDE "WIN32API.INC" #INCLUDE "COMMCTRL.INC" %ID_UDBUTON1 = 101 %ID_UDBUTON2 = 102 GLOBAL hDlg AS LONG GLOBAL hButton1 AS LONG CALLBACK FUNCTION DlgProc STATIC a AS LONG, x AS LONG , BSTATE AS LONG SELECT CASE CBMSG CASE %WM_INITDIALOG InitCommonControls CASE %WM_NOTIFY CASE %WM_COMMAND CASE %WM_LBUTTONDOWN a = SendMessage(GetDlgItem(CBHNDL, %ID_UDBUTON1), %BM_GETSTATE, 0, 0) AND %BST_PUSHED INCR x SetWindowText hDlg, " Counter: " + STR$(x) END SELECT END FUNCTION FUNCTION PBMAIN DIALOG NEW 0, "Button Down demo??",,, 130, 90, %WS_OVERLAPPEDWIN TO hDlg CONTROL ADD BUTTON, hDlg, %ID_UDBUTON1,"+", 10, 10, 20,20,'%BS_NOTIFY ' CALL CB_Button1 CONTROL ADD BUTTON, hDlg, %ID_UDBUTON2,"-", 10, 31, 20,20,'%BS_NOTIFY 'OR %BS_OWNERDRAW CALL CB_Button2 DIALOG SHOW MODAL hDlg CALL DlgProc END FUNCTION
Eddy
------------------
[email protected]
[This message has been edited by Eddy Van Esch (edited June 19, 2001).]
Comment