musicstashall Posted October 20, 2019 Share Posted October 20, 2019 (edited) I was puzzled which message to send to the UpDown element in order to take a step to minus or plus. In the WM_NOTIFY construct, it turns out to do this, but I can’t understand how to construct the message directly. Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Local $tagNMUPDOWN = $tagNMHDR & ";int iPos;int iDelta" Local $tInfo = DllStructCreate($tagNMUPDOWN, $ilParam) $tInfo.iDelta = -1 ; step left $tInfo.iDelta = 1 ; step right EndFunc We need a way like this: GUICtrlSendMsg($ctrl, $msg, $wParam, $lParam) $lParam likely structure. $wParam not used It turned out as follows, but only the left button responds (the element is horizontal, from Tab), some more parameters are needed.: _SendMessage($hWnd, $WM_LBUTTONDOWN) ********************************************* Empirically managed to do so: Local $ptr_updown = 0 Local $aPos = ControlGetPos($GUI1, '', $hUpDown) Local $tagNMUPDOWN = "int iPos;int iDelta" Local $tInfo = DllStructCreate($tagNMUPDOWN) If _WinAPI_GetMousePosX(True, $hUpDown) > $aPos[2] /2 Then $ptr_updown = DllStructGetPtr($tInfo) $tInfo.iDelta = 1 EndIf _SendMessage($hUpDown, $WM_LBUTTONDOWN, 0, $ptr_updown) Edited October 21, 2019 by musicstashall Link to comment Share on other sites More sharing options...
musicstashall Posted October 21, 2019 Author Share Posted October 21, 2019 It turns out to be easier. In fact, it is implemented in this way.: _SendMessage($hUpDown, $WM_LBUTTONDOWN, 0, _WinAPI_MakeLong(_WinAPI_GetMousePosX(True, $hUpDown), _WinAPI_GetMousePosY(True, $hUpDown))) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now