1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. UPIA

Beiträge von UPIA

  • ColorChangeIconButton - BugWorkaround?

    • UPIA
    • 4. Dezember 2025 um 12:37

    Hi Kanashius,
    danke für deine antwort & Lösung. diese behebt das Problem, wie es sein soll und GUICtrlSetBkColor() funktioniert!
    das icon on-the-fly umzumalen hatte ich auch schon in Betracht gezogen. Allerdings würde ich die Icons bei solch einem Aufwand dann auch gerne für den nächsten Start speichern*. (und an diesem Punkt bekam ich aus GDI+ nur jpg's und keine .ico).
    "bei dem die Pixel entsprechend gesetzt werden" was passiert da? wieso funzt das ico danach auf allen farben? ich dachte zunächst das icon wird repariert und ich könnte es dann in diesem Zustand speichern, und beim nächsten Start aus dem .ico ohne Umwandlung laden.
    (ginge das??? - das wäre genau das was ich suche!)
    Aber da siegt wohl nur mein Wunschdenken über die Realität :)

    Dann werde ich mal ein kleines Farb-Button Menü mit deiner Methode basteln und vorstellen.

    Merci!!

    *Kurz zum Hintergrund:
    mein quicklauncher öffnet kleine GUI-Menüs mit Icons per Geste und Hotkeys. Diese erstelle ich beim ersten Einlesen und speicher die Icons (weil ich einige auch tauschen möchte).
      

    Die meisten Menüs haben weniger als 8 Icons, da wäre die Performance theoretisch nicht so wichtig.
    diese wollte ich nun in einer Art Windows-Start-Menü als Hauptmenü zusammenführen. Daher war ich mal nach einer brauchbaren Lösung für viele Buttons.

  • ColorChangeIconButton - BugWorkaround?

    • UPIA
    • 3. Dezember 2025 um 23:48

    Hier nochmal ein ganz einfaches Beispiel um das Problem darzustellen:
    1. Button (nicht eingefärbt) mit .ico funtz perfekt, aber eben nur mit dem default-weiß
    2. Button (eingefärbt) jetzt ist das .ico weg
    3. Button (ein gefärbtes Label mit Icon) ist immer nur transparent,
    wenn der Hintergrund des Bildes mit der des GuiBG identisch ist. ("See this bug!")

    AutoIt
    #include <GUIConstantsEx.au3>
    #include <GUIConstants.au3>
    
    Example()
    
    Func Example()
    	Local $bg_color = 0xf0f0f0
        Global $hGUI = GUICreate("GuiTest", 300, 200)
    
        ; Create a button control. - from examples working perfectly with trans icon on Default Color (No GUISetBkColor!) but has no color!
        Local $idButton_1 = GUICtrlCreateButton("", 30, 30, 48, 48, $BS_ICON)
    	GUICtrlSetTip ( $idButton_1, "DefBtn", "")
    	Local $idIcon_1 = GUICtrlSetImage($idButton_1, "C:\Windows\System32\imageres.dll", -82, 1)
    
    	; The same but with color => not showing .ico file
        Local $idButton_2 = GUICtrlCreateButton("ColBtn", 100, 30, 48, 48, $BS_ICON)
    	GUICtrlSetTip ( $idButton_2, "no ico!", "")
    	GUICtrlSetBkColor($idButton_2, 0x666666)
    	Local $idIcon_2 = GUICtrlSetImage($idButton_2, "C:\Windows\System32\imageres.dll", -82, 1)
    
    	; Createing a color label with the icon as pseudo-button works ONLY if GUI-BG-color is  same as the icons background
        Local $idButton_3 = GUICtrlCreateLabel("", 170, 30, 48, 48)
    	GUICtrlSetTip ( $idButton_3, "bad ico", "")
    	GUICtrlSetBkColor($idButton_3, 0x666666)
    	Local $idIcon_3 = GUICtrlCreateIcon("C:\Windows\System32\imageres.dll", -82, 178,38, 32,32)
    
    	; Press this button to "solve" the problem
        Local $idButton_Switch = GUICtrlCreateButton("See the bug!", 210, 170, 85, 25)
    
        GUISetState(@SW_SHOW, $hGUI)
    
        Local $iPID = 0
    
        ; Loop until the user exits.
        While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    ExitLoop
    			Case $idButton_Switch
    				If $bg_color = 0xf0f0f0 Then
    					$bg_color = 0x666666
    					GUISetBkColor($bg_color, $hGUI)
    					$msg = "nice ico"
    				ElseIf $bg_color = 0x666666 Then
    					$bg_color = 0xf0f0f0
    					GUISetBkColor($bg_color, $hGUI)
    					$msg = "bad ico"
    				EndIf
                Case $idButton_1
                    ; Run Notepad with the window maximized.
                    MsgBox(0,"Default Button", "ico is transparent, but surface has fix color!")
                Case $idButton_2
                    ; Run Notepad with the window maximized.
                    MsgBox(0,"Default Button with Color", "Color set with GUICtrlSetBkColor() prevents ico")
                Case $idButton_3
                    ; Run Notepad with the window maximized.
                    MsgBox(0,"Label-Button", "Color will only work with transparency if gui-bg-bol matches the Label!")
    
            EndSwitch
        WEnd
    
        ; Delete the previous GUI and all controls.
        GUIDelete($hGUI)
    
        ; Close the Notepad process using the PID returned by Run.
        If $iPID Then ProcessClose($iPID)
    EndFunc   ;==>Example
    Alles anzeigen

    Als Lösungsweg ohne WinApi/GDI+ .. hab ich nichts anderes gefunden. So lässt sich auch ein Button mit States Static/Hover/Press gestalten.
    Das ist aber auch das Limit der Methode für Buttons mit State-orientierten Farben, denn ab 2 Buttons in unterschiedlichen States funktioniert das natürlich nicht mehr. Also Workaround 2 eine (sub)GUI pro Button setzen. (siehe erster Post).

  • ColorChangeIconButton - BugWorkaround?

    • UPIA
    • 3. Dezember 2025 um 14:09

    Es ist mir nicht gelungen einen farbigen Button mit OnmouseOver-Effekt UND transparentem .ico zu erstellen.
    Wahrscheinlich wegen des GUI-Bugs werden die transparenten Teile eines .ico Files immer in der Farbe der GUI-BG-Color dargestellt.
    Ein möglicher Weg dies (mit einfachen Mitteln) zu umgehen ist es die ButtonFarbe unter dem Icon gleichzeitig mit der GUI-BG-Color zu wechseln.
    Das klappt prima, solange ich nur einen Button habe. Habe ich mehrere Buttons brauche ich für jeden Button eine subGUI ...

    Das habe ich hier mal umgesetzt. Macht dies Methode wirklich Sinn?
    Oder gibt es da inzwischen leichtere Workarounds?
    (ich habe stundenlang gesucht, aber just diese Problemlösung des Icons nicht gefunden)

    Im Beispiel habe ich 24 Buttons, weil ich die Kapazität von GUIGetMsg() testen wollte, scheint aber zu gehen.
    Beim Clicken wird nur in die Console geloggt (keine Action).
    Außerdem wäre mein nächstes Ziel dass die GUI beim Aufbau nicht so sehr flackert (habe bisher - offensichtlich - nicht viel mit GUIs gearbeitet).
    Programmierstil und Ordentlichkeit sind furchtbar :love: sorry ist work in prgoress!

    Vorschau:


    IconButtonHoverEffect.au3:

    AutoIt
    #include <GUIConstants.au3>
    #include <Array.au3>
    
    ; This script creates colored button-like-control-set with states with proper icon
    ; ------------------------------------------------------------------------------------------------------------------- BG + Text/ButtonStyle Setup
    Global $_Buttons[1][21]
    $_Buttons[0][0] = 0
    Global $_ButtonGuiOverlay 	= 0x999999		; use this overlay to hide the true bg-color as it changes
    Global $_ButtonStyle[1][10] = [ _ ;FontCol,Size,Weight,Attribute,Fontname,winhandle,quality,LableStyle,LabelStyleX
    							  [ 0xfffffff, 12, 400, Default, "Tahoma", Default, Default, Default, Default]]
    
    ; ------------------------------------------------------------------------------------------------------------------- Create GUI & Buttons
    Local $hGUI = GUICreate("ColorChangeIconButton Test", 800, 870, -1, -1)									; global $hGUI (Main)
    ;~ GUISetState(@SW_HIDE, $hGUI)
    GUISetBkColor($_ButtonGuiOverlay, $hGUI)
    GUISetState(@SW_SHOW)
    Local $plate = GUICtrlCreateLabel("", 0,0, 800, 870)								; main Surface of GUI (used to get onmouseover for hover-out
    GUICtrlSetBkColor($plate, $_ButtonGuiOverlay)
    GUISetState(@SW_SHOW, $hGUI) ; no idea how to make this not flicker on startup!
    
    Local $butt1 = _ButtonCreate($hGUI, $plate, "", "Test", 100, 100, 50, 50, 0xcccccc, 0x00cccc, 0x00ffff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn") ; add userfunction???
    Local $butt2 = _ButtonCreate($hGUI, $plate, "", "", 200, 100, 50, 50, 0xcccccc, 0x00cccc, 0x00ffff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt3 = _ButtonCreate($hGUI, $plate, "", "", 300, 100, 50, 50, 0x2277ff, 0x114477, 0xff00ff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt4 = _ButtonCreate($hGUI, $plate, "", "", 400, 100, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt5 = _ButtonCreate($hGUI, $plate, "", "", 100, 200, 50, 50, 0x2277ff, 0x114477, 0xff00ff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt6 = _ButtonCreate($hGUI, $plate, "", "", 300, 200, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt7 = _ButtonCreate($hGUI, $plate, "", "", 400, 200, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt8 = _ButtonCreate($hGUI, $plate, "", "Test", 200, 200, 50, 50, 0xcccccc, 0x00cccc, 0x00ffff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt9 = _ButtonCreate($hGUI, $plate, "", "", 100, 300, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt10 = _ButtonCreate($hGUI, $plate, "", "", 400, 300, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt11 = _ButtonCreate($hGUI, $plate, "", "", 200, 300, 50, 50, 0xcccccc, 0x00cccc, 0x00ffff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt12 = _ButtonCreate($hGUI, $plate, "", "", 300, 300, 50, 50, 0x2277ff, 0x114477, 0xff00ff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt13 = _ButtonCreate($hGUI, $plate, "", "", 100, 400, 50, 50, 0xcccccc, 0x00cccc, 0x00ffff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt14 = _ButtonCreate($hGUI, $plate, "", "Test", 200, 400, 50, 50, 0xcccccc, 0x00cccc, 0x00ffff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt15 = _ButtonCreate($hGUI, $plate, "", "", 300, 400, 50, 50, 0x2277ff, 0x114477, 0xff00ff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt16 = _ButtonCreate($hGUI, $plate, "", "", 400, 400, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt17 = _ButtonCreate($hGUI, $plate, "", "", 100, 500, 50, 50, 0x2277ff, 0x114477, 0xff00ff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt18 = _ButtonCreate($hGUI, $plate, "", "", 300, 500, 50, 50, 0x2277ff, 0x114477, 0xff00ff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt19 = _ButtonCreate($hGUI, $plate, "", "", 400, 500, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt20 = _ButtonCreate($hGUI, $plate, "", "", 200, 500, 50, 50, 0xcccccc, 0x00cccc, 0x00ffff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt21 = _ButtonCreate($hGUI, $plate, "", "", 100, 600, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt22 = _ButtonCreate($hGUI, $plate, "", "", 400, 600, 50, 50, 0x777777, 0x007777, 0xffff00, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt23 = _ButtonCreate($hGUI, $plate, "", "", 200, 600, 50, 50, 0xcccccc, 0x00cccc, 0x00ffff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    Local $butt24 = _ButtonCreate($hGUI, $plate, "", "", 300, 600, 50, 50, 0x2277ff, 0x114477, 0xff00ff, "C:\Windows\System32\shell32.dll", 4, 32, 32, 9, 9, 0, "UserFn")
    ;_ButtonSetState(@SW_SHOW)
    GUISetState(@SW_SHOW, $hGUI)
    
    ; ------------------------------------------------------------------------------------------------------------------- GUIGetMsg Handler
    GUISwitch($hGUI)
    While 1
    	;Local $state = -1
    	Local $gm = GUIGetMsg()
    	Switch $gm
    		Case $GUI_EVENT_CLOSE ; add custom stuff on hGUI here!
    			CloseProgram()
    ;~ 		Case $GUI_EVENT_PRIMARYUP ; not reliable, play for some ms only
    ;~ 			$state = 0
    ;~ 		Case $GUI_EVENT_PRIMARYDOWN
    ;~ 			Local $state = 1
    		Case Else
    			_ButtonGetEvent($gm)
    	EndSwitch
    	Sleep(10)
    WEnd
    
    CloseProgram()
    
    ; use sth this to add actions to the button states
    Func UserFn($id, $bID, $_Event, $userA)
    	_log("UserFn --------------------------------------------")
    	Switch $_Event
    		Case "Static"
    			;
    		Case "Hover"
    			;
    		Case "Press"
    			If IsArray($userA) Then
    				;
    			Else
    				;MsgBox(0, "$_Buttons", "$_Buttons[" & $id & "][0] = " & $bID & " .. was pressed!") ; dont use msgbox when button is down!
    				_log("do something...")
    			EndIf
    	EndSwitch
    EndFunc
    
    ; ------------------------------------------------------------------------------------------------------------------- Functions --->
    
    ;	Catch GuiGetMsg() And GuiGetCursorInfo() to create events
    Func _ButtonGetEvent($gm)
    	For $i = 1 To $_Buttons[0][0]
    		Local $bL = $_Buttons[$i][0]
    		Local $bI = $_Buttons[$i][1]
    		If $gm > 0 Then
    			If $gm = $bL Or $gm = $bI Then															; check if buttons(label or icon) are Presssed
    				_ButtonHandle($_Buttons[$i][0], "Press")
    				;ExitLoop ;only 1 event?
    			EndIf
    		Else
    			Local $gui = $_Buttons[$i][19]
    			Local $info = GUIGetCursorInfo($gui)													; check cursor for hover
    			If ($info[4] = $bL Or $info[4] = $bI) Then ;And $state <> 1 Then
    				_ButtonHandle($_Buttons[$i][0], "Hover")
    				ExitLoop
    			ElseIf ($info[4] <> $bL And $info[4] <> $bI) And $_Buttons[$i][20] = "Hover" Then
    				_ButtonHandle($_Buttons[$i][0], "Static")
    				ExitLoop
    			EndIf
    		EndIf
    	Next
    EndFunc
    
    ;	Destroy a Button
    Func _ButtonDestroy($i, $index=False) ;?
    	If Not $index Then
    		$i = _ArraySearch($_Buttons, $i, 1, 0, 0, 0, 1, 0)
    		If $i < 0 Then
    			MsgBox(64, "Error", "No Index")
    			Return False
    		EndIf
    	EndIf
    	_ArrayDelete($_Buttons, String($i))
    	$_Buttons[0][0] -= 1 ;UBound($_Buttons+1)
    	;_ArrayDisplay($_Buttons)
    EndFunc
    
    ; 	Create "Button" as a LabelControl and save data for handling
    ; 	MainGUI, SurroundingSurfaceHnd, optButtonText, optTooltipText, x, y, w,           h, RegularColor, HoverColor, PressColor, IconFile, IconIndex, IconWidth,    IconHight, xOffIcon, yOffIcon,  ButtonSyle, userfn, userdata
    Func _ButtonCreate($hGUI, $hSurface, $strText, $strTooltip, $xPos, $yPos, $bWidth, $bHight, $colStatic, $colHover, $colPress, $iconFile, $iconIndex, $iconSizeX, $iconSizeY, $iconXoff, $iconYoff, $bStyle, $UserFn, $UserData=-1)
    	Local $ctrlID = -1, $icon[3]
    	Local $hChild = GUICreate("", $bWidth, $bHight, $xPos, $yPos, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
    	GUISwitch($hChild)
    	GUISetState(@SW_DISABLE, $hChild)
    	GUISetState(@SW_HIDE, $hChild)
    	; FontSetup
    	GUISetFont($_ButtonStyle[$bStyle][1], $_ButtonStyle[$bStyle][2], $_ButtonStyle[$bStyle][3], $_ButtonStyle[$bStyle][4], $hChild, $_ButtonStyle[$bStyle][6])
    	$ctrlID = GUICtrlCreateLabel($strText, 0, 0, $bWidth, $bHight)
    	GUICtrlSetColor($ctrlID, $_ButtonStyle[$bStyle][0])
    	If $strTooltip <> "" Then GUICtrlSetTip ( $ctrlID, $strTooltip, "", $TIP_NOICON, $TIP_CENTER)
    	;
    	GUISetBkColor($colStatic, $hChild)												;set state static
    	GUICtrlSetBkColor($ctrlID, $colStatic)
    	$icon[0] = GUICtrlCreateIcon($iconFile, $iconIndex, 0+$iconXoff, 0+$iconYoff, $iconSizeX, $iconSizeY, Default)
    
    	GUISetState(@SW_ENABLE, $hChild)
    	GUISetState(@SW_SHOW, $hChild)
    
    	$_Buttons[0][0] += 1														; store data for handling
    	ReDim $_Buttons[ $_Buttons[0][0]+1 ][25]
    	$_Buttons[ $_Buttons[0][0] ][0] = $ctrlID
    	$_Buttons[ $_Buttons[0][0] ][1] = $icon[0]
    ;~ 	$_Buttons[ $_Buttons[0][0] ][2] = $icon[1]
    ;~ 	$_Buttons[ $_Buttons[0][0] ][3] = $icon[2]
    	$_Buttons[ $_Buttons[0][0] ][4] = $hGUI
    	$_Buttons[ $_Buttons[0][0] ][5] = $hSurface
    	$_Buttons[ $_Buttons[0][0] ][6] = $strText
    	$_Buttons[ $_Buttons[0][0] ][7] = $strTooltip
    	$_Buttons[ $_Buttons[0][0] ][8] = $xPos
    	$_Buttons[ $_Buttons[0][0] ][9] = $yPos
    	$_Buttons[ $_Buttons[0][0] ][10] = $bWidth
    	$_Buttons[ $_Buttons[0][0] ][11] = $bHight
    	$_Buttons[ $_Buttons[0][0] ][12] = $colStatic
    	$_Buttons[ $_Buttons[0][0] ][13] = $colHover
    	$_Buttons[ $_Buttons[0][0] ][14] = $colPress
    	$_Buttons[ $_Buttons[0][0] ][15] = $iconIndex
    	$_Buttons[ $_Buttons[0][0] ][16] = $iconSizeX
    	$_Buttons[ $_Buttons[0][0] ][17] = $iconXoff
    	$_Buttons[ $_Buttons[0][0] ][18] = $iconYoff
    	$_Buttons[ $_Buttons[0][0] ][19] = $hChild
    	$_Buttons[ $_Buttons[0][0] ][20] = $bStyle
    	$_Buttons[ $_Buttons[0][0] ][21] = $iconSizeY
    	$_Buttons[ $_Buttons[0][0] ][22] = $UserFn
    	$_Buttons[ $_Buttons[0][0] ][23] = $UserData
    	;MsgBox(0,"done","")
    	Return $ctrlID
    EndFunc
    
    ;	Handle Button States
    Func _ButtonSetState($Flag) ;?
    	_log("Set " & $_Buttons[0][0] & " Flags")
    	GUISetState(@SW_HIDE, $hGUI)
    	For $i = 1 To $_Buttons[0][0]
    		Local $gui = $_Buttons[ $i ][19]
    		GUISetState($Flag, $gui)
    	Next
    	GUISetState(@SW_SHOW, $hGUI)
    EndFunc
    
    ;	Handle Button Colors due to events
    Func _ButtonHandle($bID, $_Event)
    	Local $id = _ArraySearch($_Buttons, $bID, 1, 0, 0, 0, 1, 0)
    	If $id > 0 And $_Buttons[$id][20] <> $_Event Then
    		_log("_ButtonHandle( " & $bID & " , " & $_Event & ") -  Button found: " & $id)
    		Switch $_Event
    			Case "Hover"
    				GUISetBkColor($_Buttons[$id][13], $_Buttons[$id][19])
    				GUICtrlSetBkColor($_Buttons[$id][0], $_Buttons[$id][13])
    				GUISetState(@SW_SHOW, $_Buttons[$id][19])
    			Case "Press"
    				GUISetBkColor($_Buttons[$id][14], $_Buttons[$id][19])
    				GUICtrlSetBkColor($_Buttons[$id][0], $_Buttons[$id][14])
    				GUISetState(@SW_SHOW, $_Buttons[$id][19])
    				Local $fn = $_Buttons[$id][22]
    				Local $data = $_Buttons[$id][23]
    				_log("Calling: " & $fn & ", " & $id & ", " & $bID)
    				Call($fn, $id, $bID, $_Event, $data)
    			Case "Static"
    				GUISetBkColor($_Buttons[$id][12], $_Buttons[$id][19])
    				GUICtrlSetBkColor($_Buttons[$id][0], $_Buttons[$id][12])
    				GUISetState(@SW_SHOW, $_Buttons[$id][19])
    		EndSwitch
    	EndIf
    	$_Buttons[$id][20] = $_Event
    EndFunc
    
    Func CloseProgram()
    	GUISetState(@SW_HIDE, $hGUI)
    	For $i = 1 To $_Buttons[0][0]
    		GUISetState(@SW_HIDE, $_Buttons[$i][20])
    		GUIDelete($_Buttons[$i][20])
    	Next
    	GUIDelete($hGUI)
    	Exit 0
    EndFunc
    
    Func _log($str)
    	ConsoleWrite($str & @CRLF)
    EndFunc
    Alles anzeigen


    Freu mich :party: über Feedback!

    Dateien

    IconButtonHoverEffect.7z 2,82 kB – 433 Downloads
  • Arbeiten mit AutoIt (Windows Defender, UAC ...)

    • UPIA
    • 26. November 2025 um 16:21
    Zitat von Moombas


    Entsprechend würde ich Verfahren, wenn er auch für die exe Dateien anschlägt, die entsprechenden Verzeichnisse

    danke hat prima gefunzt!!

  • Arbeiten mit AutoIt (Windows Defender, UAC ...)

    • UPIA
    • 24. November 2025 um 14:31

    Hi Leute,
    ich mache gerade wieder einiges mit AutoIt (auf Win11) und frage mich wie ich eigentlich mit den Virenwarnungen (FalsePositives) meiner compileten .exe files von Windows und dem UAC-Prompt (ohne komplett ausschalten zu müssen) umgehen sollte.

    Hatte nix gefunden, gibt es hier Tipps / Anleitung oder ähnliches?

  • GUI erstellen mit mehreren Bereichen?

    • UPIA
    • 20. April 2021 um 18:23

    okay, habs gefunden, das ganze 300pix nach rechts zu schieben (weiss nicht wie ich das übersehen konnte).

    Code
       _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBMP, 300, 0, $hWidth, $hHeight)

    jetzt bräuchte ich nur noch ein bg-pic, bekomme das aber nicht rein mit GUICtrlCreatePic

    hier mal nur der wesentliche teil für das bild: (testscript)

    C
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <WinAPI.au3>
    #include <Array.au3>
    ;#include <StaticConstants.au3>
    
    ;~ Opt("GUIOnEventMode", 1)
    ;~ Opt("MustDeclareVars", 1)
    
    Global $xSIZEX = 766;416*2
    Global $xSIZEY = 748;416
    
    Global $xGUIx = 1366
    Global $xGUIy = 748
    Global $BGimage = @ScriptDir & "\images\background.png"
    ConsoleWrite($BGimage & @CRLF)
    
    #region setup
    ;~ Global $hWidth = $xSIZEX
    ;~ Global $hHeight = $xSIZEY
    ;~ Global $dll = DllOpen("user32.dll")
    ;~ HotKeySet("{SPACE}", "_shoot")
    
    Global $hWnd = GUICreate("Mia & me - Distopian Attack (c) 2021 for SOSO", $xGUIx, $xGUIy) ;, -1, -1, $WS_BORDER)
    ConsoleWrite($hWnd & @CRLF)
    ;~ GUISetBkColor (0xcccccc, $hWnd )
    ;~ Global $BGlabel = GUICtrlCreateLabel("", 0, 0, 1366, 748)
    ;~ GUICtrlSetBkColor(-1, 0xcccccc)
    ;~ ConsoleWrite($BGlabel & @CRLF)
    Global $BGpic = GUICtrlCreatePic($BGimage, 0, 0, 1366, 748)
    ConsoleWrite($BGpic & @CRLF)
    Global $AliasButton = GUICtrlCreateButton("PlayerName", $xGUIx - 100, $xGUIy - 30, 80, 20)
    ConsoleWrite($AliasButton & @CRLF)
    GUISetOnEvent($GUI_EVENT_CLOSE, "close")
    ;~ GUICtrlSetState(-1, $GUI_DISABLE)
    ;GUISetState(@SW_SHOW)
    GUISetState()
    ;~ MsgBox(64,"","")
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
             Case $AliasButton
                ConsoleWrite("Button" & @CRLF)
        EndSwitch
        Sleep(10)
    WEnd
    Alles anzeigen

    EDIT 2: okay, ich male das bild einfach mit GDIPlus rein, das funzt. mit GUICtrlCreatePic hab ich s nicht hinbekommen.

    Würde mich dennoch interessieren was an meinem code falsch ist.

  • GUI erstellen mit mehreren Bereichen?

    • UPIA
    • 20. April 2021 um 17:13

    hi, hier mal was ich vorhabe ... (ist ein spaceinvader von Eigensheep (00), den ich auf mia&me getrimmt habe) ... das original ist hier: https://www.autoitscript.com/forum/topic/15…me-with-autoit/

    das ganze ist aufs thinkpad meiner tochter optimiert 1366x768

    .. ach ja PSSSSST, das soll ein Geschenk werden :):part:

    Bilder vom Menü und Game hier: Menü, Game

    Also mir wäre schon geholfen, wenn ich die Animation mittig darstellen könnte und in den Hintergrund ein Bild legen könnte, so dass man 300pixel links und rechts davon sieht.

    so hier mal das wesentliche vom code ...

    Spoiler anzeigen
    C
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <WinAPI.au3>
    #include <Array.au3>
    
    Opt("GUIOnEventMode", 1)
    Opt("MustDeclareVars", 1)
    
    AutoItSetOption("GUICloseOnESC", 0)
    
    #region start
    _GDIPlus_Startup()
    Global $hWnd = GUICreate("Mia & me - Distopian Attack (c) 2021 for SOSO", $xGUIx, $xGUIy, 300, 0) 
    Global $AliasButton = GUICtrlCreateButton("PlayerName", $xGUIx - 100, $xGUIy -30, 80, 20)
    GUISetOnEvent($GUI_EVENT_CLOSE, "close")
    GUISetState()
    
    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Global $hBMP = _GDIPlus_BitmapCreateFromGraphics($hWidth, $hHeight, $hGraphics)
    Global $bmG = _GDIPlus_ImageGetGraphicsContext($hBMP)
    _GDIPlus_GraphicsSetSmoothingMode($bmG, 2)
    _GDIPlus_GraphicsClear($bmG, 0xFF000000)
    #endregion
    
    ;create logo
    $bmpLogo = _GDIPlus_BitmapCreateFromGraphics(260, 140, $hGraphics)
    Local $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\DistopianAttack.bmp")
    Local $graphics2 = _GDIPlus_ImageGetGraphicsContext($bmpLogo)
    _GDIPlus_GraphicsSetSmoothingMode($graphics2, 2)
    _GDIPlus_GraphicsClear($graphics2, 0xFF000000)
    _GDIPlus_GraphicsDrawImageRect($graphics2, $hImage, 0,0, 260,140)
    _GDIPlus_GraphicsDispose($graphics2)
    _GDIPlus_GraphicsDispose($hImage)
    
    
    _menu()
    $mTimer = TimerInit()
    
    While 1    ; -------------------- Draw animation (game)
       If $RUN Then
    
       _GDIPlus_GraphicsClear($bmG, 0xFF000000)
    
       ;... drawing animation here ...
       
       ;... static text
       _GDIPlus_GraphicsFillRect($bmG, 0, $xBoundB + 16, $hWidth, 1, $hBrushGreen)
       _GDIPlus_GraphicsDrawStringEx($bmG, "SCORE", $hFont, $tLayout_ScoreName, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, _padScore($score), $hFont, $tLayout_Score, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, "HI-SCORE", $hFont, $tLayout_HiScoreName, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, _padScore($highscore), $hFont, $tLayout_HiScore, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, "LIVES", $hFont, $tLayout_Lives, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, $xTITLE, $hFont, $tLayout_Title, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, "(c) 00 UPIA", $hFont, $tLayout_Credit, $hFormat, $hBrushWhite)
    
    
       If $lives == 0 Then
          reset()
          _menu()
       EndIf
    
       If $xSPEED > 0 Then Sleep($xSPEED)
       ;-----------------------------------------------------------
       Else
          Sleep(50)
       EndIf
       If _IsPressed("0D", $dll) Then
          While _IsPressed("0D", $dll) = 1
             Sleep(250)
          WEnd
          pause()
       EndIf
       If _IsPressed("1B", $dll) Then
          ;show menu
          reset()
          _menu()
       EndIf
    WEnd
    
    ;menu-mode
    Func _menu()
       Local $sTimer = TimerInit()
       SoundPlay(@ScriptDir & "\sounds\" & "Centopia.mp3")
       _GDIPlus_GraphicsClear($bmG, 0xFF000000)
       _GDIPlus_GraphicsDrawStringEx($bmG, "SCORE", $hFont, $tLayout_ScoreName, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, _padScore($score), $hFont, $tLayout_Score, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, "HI-SCORE", $hFont, $tLayout_HiScoreName, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, _padScore($highscore), $hFont, $tLayout_HiScore, $hFormat, $hBrushWhite)
       ;_GDIPlus_GraphicsDrawStringEx($bmG, $xTITLE, $hFont, $tLayout_Title, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawImageRect($bmG, $bmpLogo, $hWidth/2 - 130, 0, 260, 140)        ;---logo
    
       _GDIPlus_GraphicsDrawStringEx($bmG, "(c) 00 UPIA", $hFont, $tLayout_Credit, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, "press [ENTER] to PLAY", $hFont, $tLayout_Play, $hFormat, $hBrushYellow)
       _GDIPlus_GraphicsDrawStringEx($bmG, " close WINDOW to QUIT", $hFont, $tLayout_Quit, $hFormat, $hBrushYellow)
       _GDIPlus_GraphicsDrawStringEx($bmG, "---- SCORE TABLE ----", $hFont, $tLayout_ScoreList, $hFormat, $hBrushRed)
    
       _GDIPlus_GraphicsDrawStringEx($bmG, "= ?? MYSTERY", $hFont, $tLayout_Mystery, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawImageRect($bmG, $bmpObj[7], $hWidth/2 - 87, 170+60, $aSizeX, $aSizeY)         ;------------gargona
       _GDIPlus_GraphicsDrawStringEx($bmG, "= 30 POINTS", $hFont, $tLayout_Points1, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawImageRect($bmG, $bmpObj[1], $hWidth/2 - 87, 210+60, $aSizeX, $aSizeY)        ;-----fire
       _GDIPlus_GraphicsDrawStringEx($bmG, "= 20 POINTS", $hFont, $tLayout_Points2, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawImageRect($bmG, $bmpObj[5], $hWidth/2 - 87, 250+60, $aSizeX, $aSizeY)        ;----bugs
       _GDIPlus_GraphicsDrawStringEx($bmG, "= 10 POINTS", $hFont, $tLayout_Points3, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawImageRect($bmG, $bmpObj[6], $hWidth/2 - 87, 290+60, $aSizeX, $aSizeY)        ;---muncs
    
       _GDIPlus_GraphicsDrawStringEx($bmG, "--- TOP TEN HEROES ---", $hFont, $tLayout_HiScoreT, $hFormat, $hBrushGreen)
    
       Local $playerlist =""
       Local $scorelist =""
       For $i = 1 To $hiscores[0][0]
          $playerlist &= StringUpper($hiscores[$i][0]) & @LF
          $scorelist &= _padScore($hiscores[$i][1], " ") & @LF
       Next
       _GDIPlus_GraphicsDrawStringEx($bmG, $playerlist, $hFont, $tLayout_HiTable, $hFormat, $hBrushWhite)
       _GDIPlus_GraphicsDrawStringEx($bmG, $scorelist, $hFont, $tLayout_HiPoints, $hFormat, $hBrushWhite)
    
    
       _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBMP, 0, 0, $hWidth, $hHeight)
       While 1
          Local $gmsg = GUIGetMsg()    ; not working :(
          If $gmsg = $AliasButton Then
             ConsoleWrite("Button")
             Local $newalias = InputBox("Enter your Name", "max. 12 digits (string)", "")
          EndIf
          If TimerDiff($sTimer) > 120000 Then
             $sTimer = TimerInit()
             SoundPlay(@ScriptDir & "\sounds\" & "Centopia.mp3")
          EndIf
          If _IsPressed("0D", $dll) Then
             While _IsPressed("0D", $dll) = 1
                Sleep(250)
             WEnd
             SoundPlay("")
             Return ;escape (make this space?
          EndIf
          Sleep(10)
       WEnd
    EndFunc
    
    
    Func close() ;shuts down GDIPlus
       _GDIPlus_GraphicsDispose($hGraphics)
       _GDIPlus_GraphicsDispose($bmG)
       _GDIPlus_BitmapDispose($hBMP)
       _GDIPlus_BrushDispose($hBrushWhite)
       _GDIPlus_BrushDispose($hBrushGreen)
       _GDIPlus_StringFormatDispose($hFormat)
       _GDIPlus_FontFamilyDispose($hFamily)
       _GDIPlus_FontDispose($hFont)
       For $i = 0 To UBound($bmpObj)-1
          _GDIPlus_BitmapDispose($bmpObj[$i])
       Next
       _GDIPlus_Shutdown()
       DLLClose($dll)
       Exit
    EndFunc
    Alles anzeigen
  • GUI erstellen mit mehreren Bereichen?

    • UPIA
    • 20. April 2021 um 12:37

    Hi Leute,

    ich habe eine GUI erstellt 1366x748 und animiere aber nur den mittleren Bereich.

    das macht die Animation extrem langsam, weil ich die statischen Ränder jeden Frame neu reinmale.

    Kann ich die Gui auch in 3 Bereiche splitten, so dass ich nur den mittleren bereich neu aufbauen muss:

    1. static picture (width=300)

    2. animiert mit gdiplus (width=766)

    3. static picture (width=300)

    oder eine Background-Image hinterlegen (Bereich 1) und nur die Mitte animiert.

    Geht das überhaupt?

    Hab schon lang nix mehr mit AutoIt gemacht und ganz selten was mit GUI's.

    Hänge hier :party: - wäre über jeden Tipp dankbar!!

  • BitShift (unsigned INT)

    • UPIA
    • 14. März 2019 um 23:07

    okay, werde mir das am WE mal anschauen,

    solange lasse ich den thread mal noch offen.

    danke für die Antworten!!

  • BitShift (unsigned INT)

    • UPIA
    • 14. März 2019 um 17:06

    ja aber natürlich sprach ich vom Zahlenuniversum :)

    Für Multiplikation, Division, etc ist die Bignum.au3 ja super (hatte die auch schon im Einsatz),

    aber da ist ja keine BitXOR drin (oder hab ich was übersehen?).

    und die _BitXOR64 wirft mir bei sehr großen Zahlen (> 64bit) ein anderes Ergebnis aus als C++ (das hatte ich beim Schnelltesten der Binary.au3 übersehen)

    Code
    _BitXOR64(7169266485658129490, 17399588354581095834) 

    sry, hatte mich da nicht klar ausgedrückt ..

  • BitShift (unsigned INT)

    • UPIA
    • 14. März 2019 um 11:51
    Zitat von Musashi

    Mit "... das Thema hatten wir vor kurzem" meinst Du wahrscheinlich : Zahlen größer 64-Bit , oder ?

    Gruß Musashi

    Hi,

    da bin ich nochmal - hatte mich da leider zu früh gefreut ...

    denn die Zahlen in meiner Funktion haben teilweise bis 20-Stellen.

    die meisten Rechenaufgaben bekomme ich mit der Bignum.au3 hin.

    Aber die Binary.au3 scheint diese nicht mehr zu unterstützen. z.B.

    Code
    _BitXOR64(7169266485658129490,17399588354581095834) = 2054105551196646317 <> 10523109720805372360

    Habt Ihr da noch eine Idee?

    Oder haben wir den Rand des Universums bereits erreicht?

    :Glaskugel:

  • BitShift (unsigned INT)

    • UPIA
    • 13. März 2019 um 15:59

    EDIT: habe die zwei letzten Antworten erst nach meinem post gesehen, versuche das gleich mal .. danke!

    ... und ich habe es mit der Binary.au3 (obere) problemlos hinbekommen!!!

    Danke für die Hilfe!!!

    :party:

  • BitShift (unsigned INT)

    • UPIA
    • 13. März 2019 um 12:21

    hallo,

    ich suche eine zuverlässige BitShift Funktion, die mit Unsigned-Integer's und großen Zahlen klarkommt (also wie in anderen sprachen eben auch).

    Hab mir schon unzählige workaround-funktionen heruntergeladen, aber keine macht das was sie soll.

  • USB-HID Gerät Tasten abfragen

    • UPIA
    • 16. Juli 2017 um 16:35

    Hallo,
    ich versuche schon seit einigen Wochen die Tasten meines USB-Infinity Pedals per AutoIt zu erkennen.
    die hidtrace.exe erkennt das Gerät wie folgt:
    VEC USB Footpedal // VID=05f3|PID=00ff(120)|Size=2/-1VID=05f3|PID=00ff(120)|Size=2/-1

    Spoiler anzeigen
    Code
    Page: 0
    
    
        0  1 
      _______
    0| 00 00 
    
    
    
    
       01234567 89ABCDEF
      __________________
    0| 00000000 00000000
    Alles anzeigen



    ich habe auch diesen code ausprobiert: (Gerät wird gefunden)

    Spoiler anzeigen
    C
    #include <APISysConstants.au3>
    #include <Array.au3>
    #include <WinAPISys.au3>
    Local $tText, $aData = _WinAPI_EnumRawInputDevices()
    If IsArray($aData) Then
        ReDim $aData[$aData[0][0] + 1][3]
        $tText = DllStructCreate('wchar[256]')
        For $i = 1 To $aData[0][0]
            If _WinAPI_GetRawInputDeviceInfo($aData[$i][0], $tText, 256, $RIDI_DEVICENAME) Then
                $aData[$i][2] = DllStructGetData($tText, 1)
            Else
                $aData[$i][2] = ''
            EndIf
        Next
    EndIf
    _ArrayDisplay($aData, '_WinAPI_EnumRawInputDevices')
    Alles anzeigen

    Ergebnis:

    Code
    6||
    0x000904A5|1|\\?\HID#VID_046D&PID_C232#2&33093b6e&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
    0x00090431|0|\\?\HID#VID_046D&PID_C231#2&af07c4&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
    0x00020047|2|\\?\HID#ATK4001#3&37c1d7c8&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
    0x00020043|2|\\?\HID#VID_05F3&PID_00FF#6&2171edfb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
    0x0001003D|1|\\?\ACPI#ATK3001#4&24270aea&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
    0x00010035|0|\\?\ACPI#ETD0108#4&24270aea&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd}


    Einige andere Geräte wie das keyboard auf meinem laptop (0x01,0x06) und das mousepad (0x01,0x02) empfange ich mit diesem code:

    Spoiler anzeigen
    C
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseUpx=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <RawInput.au3>
    #include <WinAPI.au3>
    HotKeySet('{ESC}', '_EXIT')
    
    
    Global $tRID_KD, $pRID_KD, $iRID_KD
    Global $tRIH, $iRIH
    Global $iNumDevices
    Global $hGUI
    
    
    $hGUI = GUICreate('Test', 100, 100)
    GUIRegisterMsg($WM_INPUT, 'OnInput')
    
    
    $tRID_KD = DllStructCreate($tagRAWINPUTDEVICE)
    $pRID_KD = DllStructGetPtr($tRID_KD)
    $iRID_KD = DllStructGetSize($tRID_KD)
    
    
    $tRIH = DllStructCreate($tagRAWINPUTHEADER)
    $iRIH = DllStructGetSize($tRIH)
    
    
    $iNumDevices = 1
    
    
    DllStructSetData($tRID_KD, 'usUsagePage', 0x01)
    DllStructSetData($tRID_KD, 'usUsage', 0x06)
    DllStructSetData($tRID_KD, 'dwFlags', BitOR($RIDEV_NOLEGACY, $RIDEV_INPUTSINK))
    DllStructSetData($tRID_KD, 'hwndTarget', $hGUI)
    
    
    _RegisterRawInputDevices($pRID_KD, $iNumDevices, $iRID_KD)
    
    
    While 1
        Sleep(20)
    WEnd
    
    
    GUIDelete()
    
    
    Func OnInput($hwnd, $iMsg, $iwParam, $ilParam)
        Local $tRI_KD, $pRI_KD, $iRI_KB
        Local $iSize
    
    
    
    
        $tRI_KD = DllStructCreate($tagRAWINPUT_KEYBOARD)
        $pRI_KD = DllStructGetPtr($tRI_KD)
        $iRI_KB = DllStructGetSize($tRI_KD)
        _GetRawInputData($ilParam, $RID_INPUT, $pRI_KD, $iRI_KB, $iRIH)
        If Not @error Then
            ConsoleWrite(DllStructGetData($tRI_KD, 'Message') & @LF)
            ConsoleWrite(DllStructGetData($tRI_KD, 'VKey') & @LF)
        EndIf
    
    
        $tRI_KD = 0
        Return 'GUI_RUNDEFMSG'
    EndFunc
    
    
    Func _EXIT()
        GUIDelete()
        Exit
    EndFunc
    Alles anzeigen


    Beim letzten code hab ich schon stundenlang kombinationen von page und usage versucht,

    aber ich finde nicht / kapiere nicht wie ich die werte für page und usage bestimme.

    super wäre natürlich ein autoit-script wie hidtrace.exe, damit ich nachvollziehen kann wie man soetwas ausliest.

    ?(?(?(
    wäre dankbar für jeden tipp!!

    --

    EDIT: ich habe gerade page und usage mit usblyzer (free-demo) auslesen können.
    Dennoch würde ich gerne wissen, ob/wie man diese Werte per autoit auslesen kann,
    und damit auch andere geräte unterstützen kann.

    Spoiler anzeigen
    Code
    Connection Status Device connected 
    Current Configuration 1 
    Speed Low (1.5 Mbit/s) 
    Device Address 4 
    Number Of Open Pipes 1 
    
    
    Device Descriptor VEC USB Footpedal
    Offset Field Size Value Description 
    0 bLength 1 12h  
    1 bDescriptorType 1 01h Device 
    2 bcdUSB 2 0110h USB Spec 1.1 
    4 bDeviceClass 1 00h Class info in Ifc Descriptors 
    5 bDeviceSubClass 1 00h  
    6 bDeviceProtocol 1 00h  
    7 bMaxPacketSize0 1 08h 8 bytes 
    8 idVendor 2 05F3h PI Engineering, Inc. 
    10 idProduct 2 00FFh  
    12 bcdDevice 2 0120h 1.20 
    14 iManufacturer 1 01h "VEC " 
    15 iProduct 1 02h "VEC USB Footpedal" 
    16 iSerialNumber 1 00h  
    17 bNumConfigurations 1 01h  
    
    
    Configuration Descriptor 1 Bus Powered, 100 mA
    Offset Field Size Value Description 
    0 bLength 1 09h  
    1 bDescriptorType 1 02h Configuration 
    2 wTotalLength 2 0022h  
    4 bNumInterfaces 1 01h  
    5 bConfigurationValue 1 01h  
    6 iConfiguration 1 00h  
    7 bmAttributes 1 A0h Bus Powered, Remote Wakeup 
     4..0: Reserved  ...00000   
     5: Remote Wakeup  ..1.....  Yes 
     6: Self Powered  .0......  No, Bus Powered 
     7: Reserved (set to one)
    (bus-powered for 1.0)  1.......   
    8 bMaxPower 1 32h 100 mA 
    
    
    Interface Descriptor 0/0 HID, 1 Endpoint
    Offset Field Size Value Description 
    0 bLength 1 09h  
    1 bDescriptorType 1 04h Interface 
    2 bInterfaceNumber 1 00h  
    3 bAlternateSetting 1 00h  
    4 bNumEndpoints 1 01h  
    5 bInterfaceClass 1 03h HID 
    6 bInterfaceSubClass 1 00h  
    7 bInterfaceProtocol 1 00h  
    8 iInterface 1 00h  
    
    
    HID Descriptor 
    Offset Field Size Value Description 
    0 bLength 1 09h  
    1 bDescriptorType 1 21h HID 
    2 bcdHID 2 0100h 1.00 
    4 bCountryCode 1 00h  
    5 bNumDescriptors 1 01h  
    6 bDescriptorType 1 22h Report 
    7 wDescriptorLength 2 0023h 35 bytes 
    
    
    Endpoint Descriptor 81 1 In, Interrupt, 10 ms
    Offset Field Size Value Description 
    0 bLength 1 07h  
    1 bDescriptorType 1 05h Endpoint 
    2 bEndpointAddress 1 81h 1 In 
    3 bmAttributes 1 03h Interrupt 
     1..0: Transfer Type  ......11  Interrupt 
     7..2: Reserved  000000..   
    4 wMaxPacketSize 2 0002h 2 bytes 
    6 bInterval 1 0Ah 10 ms 
    
    
    Interface 0 HID Report Descriptor Programmable Buttons
    Item Tag (Value) Raw Data 
    Usage Page (Consumer Devices) 05 0C  
    Usage (Programmable Buttons) 09 03  
    Collection (Application) A1 01  
        Usage Page (Button) 05 09  
        Usage Minimum (Button 1) 19 01  
        Usage Maximum (Button 3) 29 03  
        Logical Minimum (0) 15 00  
        Logical Maximum (1) 25 01  
        Report Count (3) 95 03  
        Report Size (1) 75 01  
        Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02  
        Report Count (1) 95 01  
        Report Size (5) 75 05  
        Input (Cnst,Ary,Abs) 81 01  
        Report Count (1) 95 01  
        Report Size (8) 75 08  
        Input (Cnst,Ary,Abs) 81 01  
    End Collection C0
    Alles anzeigen

    => usagepage = 0x0c, usage = 0x03

  • GDI Plus Overlay: Bilder werden zu groß angezeigt

    • UPIA
    • 4. Dezember 2015 um 19:08

    :thumbup: das funzt! danke für Deine mühe!!
    mir ist auch aufgefallen, dass das problem in anderen formaten nicht präsent ist (ich habe nur mit png probiert).
    mit ImageDrawRect passt es aber perfekt egal ob jpg, gif oder png.

  • GDI Plus Overlay: Bilder werden zu groß angezeigt

    • UPIA
    • 4. Dezember 2015 um 13:40

    hi leute,

    ich steh vor einem rätsel,
    habe ein overlay gebaut, soweit alles okay,
    wenn ich aber ein bild anzeigen will wird es größer angezeigt als es ist. (ImageGetHeight ist korrekt)
    DrawRect und alle anderen Funktionen zeichnen korrekt.

    hat jemand ne idee?

    Code
    Func GUI_DrawPic($filepath, $cx, $cy, $update=True)
       Local $x = Number($cx)
       Local $y = Number($cy)
       local $hImage = _GDIPlus_ImageLoadFromFile($filepath)
       ConsoleWrite("GUI_DrawPic: " & String($update) & ", Height: " & _GDIPlus_ImageGetHeight ( $hImage ) &  @CRLF)
       _GDIPlus_GraphicsDrawImage($GUI_hGraphics, $hImage, $x, $y)
       If $update Then
    	  _WinAPI_UpdateLayeredWindow($GUI_hWnd, $GUI_hDC_Window, 0, $GUI_pSize, $GUI_hDC_Buffer, $GUI_pSource, 0, $GUI_pBlend, 2)
    	  _GUIOnTop()
       EndIf
    EndFunc
    Func GUI_DrawRect($cx,$cy, $bw,$bh, $wid=1, $color=0xffffffff, $update=True)
       Local $x = Number($cx)
       Local $y = Number($cy)
       Local $w = Number($bw)
       Local $h = Number($bh)
       Local $width = Number($wid)
       Local $col = Execute($color)
       Global $GUI_hPen = _GDIPlus_PenCreate( $col, $width)
       _GDIPlus_GraphicsDrawRect($GUI_hGraphics, $x, $y, $w, $h, $GUI_hPen)
       If $update Then
    	  _WinAPI_UpdateLayeredWindow($GUI_hWnd, $GUI_hDC_Window, 0, $GUI_pSize, $GUI_hDC_Buffer, $GUI_pSource, 0, $GUI_pBlend, 2)
    	  _GUIOnTop()
       EndIf
    EndFunc
    Alles anzeigen


    ?(<X:whistling:?(

    EDIT: hier noch die funktion zum erstellen des Overlay:

    Code
    Func GUI_Start()
       Global $GUI_DesktopWidth			= @DesktopWidth
       Global $GUI_DesktopHeight		= @DesktopHeight
       ConsoleWrite("GUI_Start h,w = " & $GUI_DesktopWidth & ", " & $GUI_DesktopHeight & @CRLF)
       Global $GUI_Show 				= True
       Global $GUI_iGUIWidth 			= $GUI_DesktopWidth
       Global $GUI_iGUIHeight 			= $GUI_DesktopHeight
       Global $GUI_vUser32DLL 			= DllOpen("User32.dll")
       Global $GUI_tSize 				= DllStructCreate($tagSIZE)
       Global $GUI_pSize 				= DllStructGetPtr($GUI_tSize)
       DllStructSetData($GUI_tSize, "X", $GUI_iGUIWidth)
       DllStructSetData($GUI_tSize, "Y", $GUI_iGUIHeight)
       Global $GUI_tSource 				= DllStructCreate($tagPOINT)
       Global $GUI_pSource 				= DllStructGetPtr($GUI_tSource)
       Global $GUI_tBlend 				= DllStructCreate($tagBLENDFUNCTION)
       Global $GUI_pBlend				= DllStructGetPtr($GUI_tBlend)
       DllStructSetData($GUI_tBlend, "Alpha", 255)
       DllStructSetData($GUI_tBlend, "Format", 1)
       _GDIPlus_Startup()
       Global $GUI_hDummy 				= GUICreate("")
       Global $GUI_hWnd 				= GUICreate("", $GUI_iGUIWidth, $GUI_iGUIHeight, 0, 0, BitOR(0x80000000, 0x08000000), BitOR(0x00080000, 0x00000008), $GUI_hDummy)
       GUISetState()
       Global $GUI_hDC_Window 			= _WinAPI_GetDC($GUI_hWnd)
       Global $GUI_hDC_Buffer 			= _WinAPI_CreateCompatibleDC($GUI_hDC_Window)
       Global $GUI_hBitmap_Buffer 		= _WinAPI_CreateCompatibleBitmap($GUI_hDC_Window, $GUI_iGUIWidth, $GUI_iGUIHeight)
       _WinAPI_SelectObject($GUI_hDC_Buffer, $GUI_hBitmap_Buffer)
       Global $GUI_hGraphics 			= _GDIPlus_GraphicsCreateFromHDC($GUI_hDC_Buffer)
       _GDIPlus_GraphicsSetSmoothingMode($GUI_hGraphics, 2)
    
    
       Global $GUI_hBrush 				= _GDIPlus_BrushCreateSolid(0xffffffff)
       Global $GUI_hFormat 				= _GDIPlus_StringFormatCreate()
       Global $GUI_hFamily 				= _GDIPlus_FontFamilyCreate("Arial")
       Global $GUI_hFont 				= _GDIPlus_FontCreate($GUI_hFamily, 24, 1)
       Global $GUI_tLayout 				= _GDIPlus_RectFCreate(100, 100, $GUI_DesktopWidth, $GUI_DesktopHeight) ;3840 × 2160
       Global $GUI_aInfo 				= _GDIPlus_GraphicsMeasureString($GUI_hGraphics, "", $GUI_hFont, $GUI_tLayout, $GUI_hFormat)
       Global $GUI_hPen 				= _GDIPlus_PenCreate( 0xffffffff, 1)
       Global $GUI_Activated = 1
       Global $GUI_Show = True
       _WinAPI_UpdateLayeredWindow($GUI_hWnd, $GUI_hDC_Window, 0, $GUI_pSize, $GUI_hDC_Buffer, $GUI_pSource, 0, $GUI_pBlend, 2)
       _GUIOnTop()
    EndFunc
    Alles anzeigen
  • Win8 Desktophintergrund "Änderungen speichern" per Script

    • UPIA
    • 1. Oktober 2014 um 02:37

    hi,

    ich möchte die veränderten Registry-Einträge für den Desktophintergrund speichern per Script.
    Der Eintrag wird richtig gesetzt, aber das speichern geht nicht.
    Habe stundenlang gegooglet, bekomme es aber nicht hin.

    Code
    Run("RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True")


    oder

    Code
    ShellExecute("C:\Windows\System32\RUNDLL32.EXE", "user32.dll, UpdatePerUserSystemParameters ,1 ,True")


    funzen bei mir ( win8 ) nicht.

    Das ganze Script zum Ändern der Diashow-Geschwindigkeit:

    Spoiler anzeigen
    Code
    Global $time = 300 ;default: 5min
    If $CmdLine[0] = 1 Then
       $time = $CmdLine[1]
    EndIf
    If $time < 1 Then $time = 1 EndIf ;minimum 1sec
    $time = $time * 1000 ;convert to MsgBox
    $time = "0x" & Hex($time)
    RegWrite("HKEY_CURRENT_USER\Control Panel\Personalization\Desktop Slideshow", "Interval", "REG_DWORD", $time)
    Run("RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True")
  • WARNUNG! Alle Battlefield 3 Spieler: LESEN!

    • UPIA
    • 20. Dezember 2012 um 02:09

    chip: was heisst da fass aufmachen?
    ich hab das lediglich mitgeteilt, damit BF3-Spieler zZt vorsichtig sind (siehe Titel) musste ja nicht lesen!
    Mindestens 20 Spieler wurden wegen meines AutoIt Applets gebannt und ich für einen leeren While-Loop.
    Evtl interessiert sowas ja andere (wenn auch nicht dich) Sorry! :rolleyes:

  • WARNUNG! Alle Battlefield 3 Spieler: LESEN!

    • UPIA
    • 19. Dezember 2012 um 22:28
    Zitat von Nathax

    Quelle?
    Ich habe die ganze Zeit lang eine mit Autoit kompilierte Anwendung laufen,
    wurde aber vorhin nicht gebannt.

    Quelle war ich, ich wurde nachweislich für den nachfolgenden Quellcode gebannt (das ist kein witz!) Link
    Das Problem bestand erst seit gestern! Der Ban kam so nach 10 - 60 minuten!
    ALLE BANS WURDEN INZWISCHEN AUFGEHOBEN! Link
    Ich werde gleich mal testen, ob jetzt alles wieder normal ist.

    C
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <Array.au3>
    #include <string.au3>
    #include <Inet.au3>
    #include <IE.au3>
    #include <File.au3>
    
    
    MsgBox(0, "Something.exe", "A False Positive!")
    
    
    While 1
       Sleep(10)
    WEnd
    Alles anzeigen
  • WARNUNG! Alle Battlefield 3 Spieler: LESEN!

    • UPIA
    • 19. Dezember 2012 um 18:02

    Achtung BF3 - Spieler!

    Derzeit werden alle Spieler gebannt die mit AutoIt compilierte Programme geöffnet haben!!!
    Grund: GAMEHACK #89800

    Selbst wenn ihr nur eine leere While-Schleife erstellt! :rofl:

    nur zur Info!

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™