wenn ich unter Windows 10 in dem Example einen Linksklick auf eines der Controls mache, sehe ich nur noch eine weiße Fläche und erst wenn ich das Mausrad bewege, erscheint es wieder wie es soll, blinkt dabei aber auch bei jeder Änderung kurz weiß auf.
Hmmm...kannst Du es mal mit dieser WindowProc versuchen:
AutoIt
Func _GuiCtrlVolume_Proc($hWnd, $iMsg, $wParam, $lParam)
Local Const $WHEEL_DELTA = 120
Local $iIndex, $hOldProc, $tMousePoint, $hChild, $iX, $iY
$iIndex = _GuiCtrlVolume_GetIndex($hWnd) ; Get the Index of the Volume-Control
$hOldProc = $__g_ahGuiCtrlVolume_Gui[$iIndex][1]
Switch $iMsg
Case $WM_DESTROY ; When deletes the Control (GUICtrlDelete)
_GuiCtrlVolume_Remove($hWnd)
Case $WM_NCHITTEST ; Test, which Volume-Control is under the Mouse
$tMousePoint = _WinAPI_MakePoint($lParam) ; Create Point-Struct from Mouse-Position
$hChild = _WinAPI_WindowFromPoint($tMousePoint) ; Get the Window (Volume-Control)
_WinAPI_SetFocus($hChild) ; Set the focus to the Control under the Mouse
Case $WM_MOUSEWHEEL ; A message even to the Parent-Window!
$tMousePoint = _WinAPI_MakePoint($lParam) ; Create Point-Struct from Mouse-Position
$hChild = _WinAPI_WindowFromPoint($tMousePoint) ; Get the Window (Volume-Control)
$iIndex = _GuiCtrlVolume_GetIndex($hChild) ; Get the Index of the Volume-Control
If @error Then Return True ; Dismiss the Message, when not over a Volume-Control (Parent-Window)
$hOldProc = $__g_ahGuiCtrlVolume_Gui[$iIndex][1] ; Get previous WindowProc
If Not BitAND($__g_ahGuiCtrlVolume_Gui[$iIndex][2], 0x80) Then ; Interpret the Message only when not muted
$__g_ahGuiCtrlVolume_Gui[$iIndex][2] += _WinAPI_HiWord($wParam) / $WHEEL_DELTA * 5 ; 5% per wheel rotation
If $__g_ahGuiCtrlVolume_Gui[$iIndex][2] < 0 Then $__g_ahGuiCtrlVolume_Gui[$iIndex][2] = 0 ; not below 0%
If $__g_ahGuiCtrlVolume_Gui[$iIndex][2] > 100 Then $__g_ahGuiCtrlVolume_Gui[$iIndex][2] = 100 ; not above 100%
_GuiCtrlVolume_SetVolumeGraphic($iIndex)
_GuiCtrlVolume_CallFunction($iIndex)
EndIf
Case $WM_LBUTTONUP ; When the User clicked left on the Volume-Control
$iX = _WinAPI_LoWord($lParam) ; X-Mouseposition
$iY = _WinAPI_HiWord($lParam) ; Y-Mouseposition
If _WinAPI_PtInRectEx($iX, $iY, 0, 2, 32, 34) Then ; when over the Mute-Image
$__g_ahGuiCtrlVolume_Gui[$iIndex][2] = BitXOR($__g_ahGuiCtrlVolume_Gui[$iIndex][2], 0x80) ; Switch between muted and not muted
Else
$__g_ahGuiCtrlVolume_Gui[$iIndex][2] = Int(100 / _WinAPI_GetWindowWidth($hWnd) * $iX) ; Else change the Volume based on the Mouseposition
EndIf
_GuiCtrlVolume_SetVolumeGraphic($iIndex)
_GuiCtrlVolume_CallFunction($iIndex)
Case $WM_PAINT
_GuiCtrlVolume_SetVolumeGraphic($iIndex)
EndSwitch
Return DllCall('user32.dll', 'lresult', 'CallWindowProc', 'ptr', $hOldProc, 'hwnd', $hWnd, 'uint', $iMsg, 'wparam', $wParam, 'lparam', $lParam)[0]
; Bug in _WinAPI_CallWindowProc (https://autoit.de/index.php?thread/86028-mehrere-udfs-mit-windowproc-verketten/&postID=690695#post690695)
EndFunc ;==>_GuiCtrlVolume_Proc
Alles anzeigen