本帖最后由 chzj589 于 2019-9-3 21:29 编辑
用:Case $NM_CUSTOMDRAW,可及时响应,但按下滑动控件拖动时,窗口会闪烁。
不知是什么原因?请帮忙看看
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
#forceref $hWnd, $iMsg, $wParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndSlider, $hWndFrom1, $hWndSlider1, $hWndFrom1, $hWndSlider1, $hWndSlider2
$hWndSlider = $g_hSlider
If Not IsHWnd($g_hSlider) Then $hWndSlider = GUICtrlGetHandle($g_hSlider)
$tNMHDR = DllStructCreate($tagNMHDR, $lParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndSlider
Switch $iCode
Case $NM_RELEASEDCAPTURE ; 控件释放鼠标捕获
_DebugPrint("$NM_RELEASEDCAPTURE" & @CRLF & "--> 控件句柄:" & @TAB & $hWndFrom & @CRLF & _
"-->控件 ID:" & @TAB & $iIDFrom & @CRLF & _
"-->操作代码:" & @TAB & $iCode)
$g = _GUICtrlSlider_GetPos($g_hSlider)
GUICtrlSetData($Input1, $g)
Local $Label = GUICtrlCreateLabel($g, 305, 50, 70, 20)
;_Debug()
#cs
Case $NM_CUSTOMDRAW
$g = _GUICtrlSlider_GetPos($g_hSlider)
GUICtrlSetData($Input1, $g)
#ce
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
|