Hi everyone, I'm using this code to verify if a checkbox was clicked in a treeview. My code is working fine in X32 environment but when I compile same code in X64 bit the function to set ib_stateclick variable is not working. For some reason the validation cannot detect the item was clicked. As a result the code in the clicked event is not executed
Any idea about this issue? Should I use a different validation in X64?
Web recommendation: https://stackoverflow.com/questions/22978768/treeview-checkboxes-how-to-i-get-the-checked-value
Reference
FUNCTION long HitMsg( long hWindow, uint uMsg, long wParam, REF OS_TVHITTESTINFO lParam ) LIBRARY "user32.dll" ALIAS FOR "SendMessageA;Ansi"
Public:
Constant uint TVM_HITTEST = 4369
Constant uint TVHT_ONITEMSTATEICON = 64
Mousemove event
OS_TVHITTESTINFO lstr_tvhittest
// Get Information on whether the State Icon has been clicked.
lstr_tvhittest.str_pt.l_x = UnitsToPixels( xpos, XUnitsToPixels! )
lstr_tvhittest.str_pt.l_y = UnitsToPixels( ypos, YUnitsToPixels! )
// Send message to retrieve handle to item pointed by mouse.
HitMsg( il_handle, TVM_HITTEST, 0, lstr_tvhittest )
// Set the flag if we are over a state checkbox.
IF lstr_tvhittest.l_hItem <> 0 THEN
ib_stateclick = ( lstr_tvhittest.l_flags = TVHT_ONITEMSTATEICON )
END IF
Clicked event
IF ib_stateclick THEN
// MY CODE
END IF