Hi,
beim folgenden Skript flackert die GUI.
Startet das Skript und haltet dann die linke Maustaste gedrückt.
Dann zieht ihr ein Fenster auf und bewegt die Maus etwas schneller.
Nun flackert die rote Fläche teilweise.
Ich nutze 3.3.16.0
Bei 3.3.4.15 war dies nicht so.
Woran könnte dies liegen?
AutoIt
#Region ;************ Includes ************
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Misc.au3>
#EndRegion ;************ Includes ************
Global $hGui_fadenkreuz1, $hGui_fadenkreuz2
Global $aStart_Pos1, $idLabel_ausschnitt
Global $UserDLL = DllOpen("user32.dll")
Global $aMouse_Pos
Global Const $iKreuz_laenge = 10000
Global $iDesktopLeft = 0
Global $iDesktopTop = 0
Global $iDesktopRight = @DesktopWidth
Global $iDesktopBottom = @DesktopHeight
;AutoItSetOption
Opt("GUICloseOnESC", 0) ;1=ESC beendet, 0=ESC schließt nicht
Opt('MouseCoordMode', 1)
Opt('GUIOnEventMode', 1)
;~ Opt("TrayIconDebug", 1) ; 0=keine Info, 1=Debug Zeileninfo
_auswahl()
Func _auswahl()
Local $status, $hGui_Auswahl, $aStart_Pos
$hGui_Auswahl = GUICreate("Screenshot", $iDesktopRight - $iDesktopLeft, $iDesktopBottom - $iDesktopTop, 0, 0, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) ; erstellen eines GUI-Fensters
WinSetTrans($hGui_Auswahl, "", 20)
GUISetState()
$aMouse_Pos = MouseGetPos()
$status = _lupe_1_punkt() ;evtl. "Abbruch"
While 1
If _IsPressed("01", $UserDLL) Then ;Linke Maustaste gedrückt
$aStart_Pos = MouseGetPos()
$status = _lupe_2_punkt() ;evtl. "Abbruch"
ExitLoop
EndIf
WEnd
EndFunc ;==>_auswahl
Func _lupe_1_punkt()
$idLabel_ausschnitt = GUICtrlCreateLabel('', $iDesktopLeft, $iDesktopTop, 1, 1, $SS_SUNKEN)
GUICtrlSetBkColor($idLabel_ausschnitt, 0xFF0000) ;rötliche Farbe des Ausschnittes
$aStart_Pos1 = MouseGetPos()
$hGui_fadenkreuz1 = GUICreate("Kreuz", $iKreuz_laenge, 1, $aStart_Pos1[0] - $iKreuz_laenge / 2, $aStart_Pos1[1], $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) ; Vergrößerungsfenster
GUISetBkColor(0x0000FF, $hGui_fadenkreuz1)
$hGui_fadenkreuz2 = GUICreate("Kreuz", 1, $iKreuz_laenge, $aStart_Pos1[0], $aStart_Pos1[1] - $iKreuz_laenge / 2, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) ; Vergrößerungsfenster
GUISetBkColor(0x0000FF, $hGui_fadenkreuz2)
WinSetOnTop($hGui_fadenkreuz1, "", 1)
WinSetOnTop($hGui_fadenkreuz2, "", 1)
GUISetState(@SW_SHOW, $hGui_fadenkreuz1)
GUISetState(@SW_SHOW, $hGui_fadenkreuz2)
While Not _IsPressed("01", $UserDLL) ;Linke Maustaste nicht gedrückt
_lupe_verschieben()
If _IsPressed("1B", $UserDLL) Then Return "Abbruch" ;Bereich Abbruch >>> "Abbruch" zurückgeben
WEnd
$aStart_Pos1 = MouseGetPos()
Return $aStart_Pos1
EndFunc ;==>_lupe_1_punkt
Func _lupe_2_punkt()
While 1
While _IsPressed("01", $UserDLL) ;Linke Maustaste gedrückt
_lupe_verschieben()
;links oben nach rechts unten:
If $aMouse_Pos[1] > $aStart_Pos1[1] And $aMouse_Pos[0] > $aStart_Pos1[0] Then GUICtrlSetPos($idLabel_ausschnitt, $aStart_Pos1[0] + 1 - $iDesktopLeft, $aStart_Pos1[1] + 1 - $iDesktopTop, $aMouse_Pos[0] - $aStart_Pos1[0], $aMouse_Pos[1] - $aStart_Pos1[1]) ;X und Y + 1 >>> sonst wird das Fenster bei einer schnellen Bewegung nicht bis ganz an den Rand gezogen
;links unten nach rechts oben:
If $aMouse_Pos[1] < $aStart_Pos1[1] And $aMouse_Pos[0] > $aStart_Pos1[0] Then GUICtrlSetPos($idLabel_ausschnitt, $aStart_Pos1[0] + 1 - $iDesktopLeft, $aMouse_Pos[1] + 1 - $iDesktopTop, $aMouse_Pos[0] - $aStart_Pos1[0], $aStart_Pos1[1] - $aMouse_Pos[1]) ;X und Y + 1 >>> sonst wird das Fenster bei einer schnellen Bewegung nicht bis ganz an den Rand gezogen
;rechts oben nach links unten:
If $aMouse_Pos[1] > $aStart_Pos1[1] And $aMouse_Pos[0] < $aStart_Pos1[0] Then GUICtrlSetPos($idLabel_ausschnitt, $aMouse_Pos[0] + 1 - $iDesktopLeft, $aStart_Pos1[1] + 1 - $iDesktopTop, $aStart_Pos1[0] - $aMouse_Pos[0], $aMouse_Pos[1] - $aStart_Pos1[1]) ;X und Y + 1 >>> sonst wird das Fenster bei einer schnellen Bewegung nicht bis ganz an den Rand gezogen
;rechts unten nach links oben:
If $aMouse_Pos[1] < $aStart_Pos1[1] And $aMouse_Pos[0] < $aStart_Pos1[0] Then GUICtrlSetPos($idLabel_ausschnitt, $aMouse_Pos[0] - $iDesktopLeft, $aMouse_Pos[1] + 1 - $iDesktopTop, $aStart_Pos1[0] - $aMouse_Pos[0], $aStart_Pos1[1] - $aMouse_Pos[1]) ;X und Y + 1 >>> sonst wird das Fenster bei einer schnellen Bewegung nicht bis ganz an den Rand gezogen
WEnd
Sleep(10)
Return $idLabel_ausschnitt
WEnd
EndFunc ;==>_lupe_2_punkt
Func _lupe_verschieben()
$aMouse_Pos = MouseGetPos()
WinMove($hGui_fadenkreuz1, "", $aMouse_Pos[0] - $iKreuz_laenge / 2, $aMouse_Pos[1])
WinMove($hGui_fadenkreuz2, "", $aMouse_Pos[0], $aMouse_Pos[1] - $iKreuz_laenge / 2)
Sleep(10)
EndFunc ;==>_lupe_verschieben
Alles anzeigen