Hi Michael,
The following is what I've done until now.
:
Function SimulateButtonClickWithParams(hWndButton As Long, lCheck As
Long) As Long
'INPUT: hWndButton als Handle des Buttons, lCheck = 1 oder 0
local lRet As Long
local hWndParent As Long
hWndParent = GetParent(hWndButton)
If hWndParent <> 0& Then
If SendMessageLong(hWndButton, BM_GETCHECK, 0&, 0&) = 1& Then
If lCheck = 0& Then 'uncheck
lRet = SendMessageLong(hWndButton, BM_CLICK, 0&,
lCheck) 'lCheck = 0
End If
ElseIf SendMessageLong(hWndButton, BM_GETCHECK, 0&, 0&) = 0&
Then
If lCheck = 1& Then
lRet = SendMessageLong(hWndButton, BM_CLICK, 0&,
lCheck) 'lCheck = 1
End If
End If
SimulateButtonClickWithParams = lRet
End If
End Function
The button handle is correct but the function works only when I first
programaticaly show the tab control where the button resides. I wonder
why.....
Bert


|