Danke noch mal, also ich habs jetzt in 4 versionen gestestet, einmal direkt danach mit -1 und ein mal mit dem Handl $hGui jeweils bei der Button Definition und hinter dem Bildaufruf. Es bleibt immer der selbe Effekt.
AutoIt
; includes ---------------------------------------------------------------------
#include-once
#include "GUIBkImage.au3"
#include "Services.au3"
#include <GDIPlus.au3>
#include <GuiCtrlSetOnHover_UDF.au3>
#include <StaticConstants.au3>
#include <String.au3>
#include <WinApi.au3>
#include <MsgBoxConstants.au3>
#include <ButtonConstants.au3>
#include <StringConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <date.au3>
#include <EditConstants.au3>
#include <Array.au3>
#include <Constants.au3>
#include <FontConstants.au3>
#include <WinAPIGdiDC.au3>
#include <WinAPIGdiInternals.au3>
#include <WinAPIHObj.au3>
#include <WinAPISysInternals.au3>
#include <ComboConstants.au3>
FileInstall("C:\Users\user\Pictures\scr09082022-084252.bmp", "C:\Windows\Temp\hg.bmp", 1)
; opt --------------------------------------------------------------------------
Opt('MustDeclareVars', 1)
;declaration ------------------------------------------------------------------
;GUI Variables
Global $ActiveCheck, $result
Global $ARRAY_COLOR_TOP_MIN[3] = [36, 65, 142]
Global $ARRAY_COLOR_TOP_MAX[3] = [11, 42, 122]
Global $RBOX_EVENT_CLOSE = 1
Global $ROUNDES = 20, $LastHwnd = 0
Global $LastHwnd
Global $GUIBKCOLOR = 0x738599
Global $SubBack = 0xEAF0E2
; processing ---------------------------------------------------------------------------------------------------------------------------------------------------
Global $hGui = RBoxCreate("Integrator 4 Release 076", 840, 625)
;FunctionCalls---------------------------------------------------------------------------------------------------------------------------------------------------
_createButtons()
;_createLabels()
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------
;------------------------------------------------------------------------------------------------------------------------------------------------
While True
CheckX($hGui, $RBOX_EVENT_CLOSE, "GuiCtrlSetColor(" & $RBOX_EVENT_CLOSE & ",0xA3A3A3)", "GuiCtrlSetColor(" & $RBOX_EVENT_CLOSE & ",0x555555)")
local $gMsg = GUIGetMsg()
Switch $gMsg
Case $GUI_EVENT_CLOSE, $RBOX_EVENT_CLOSE
GUIDelete($hGui)
Case $Combo1 ; Combo fires <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GUICtrlSetState($btnStart, $GUI_ENABLE) ; Button enabled <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Case $btnStart
IF GUICtrlRead($combo1) = "key one" Then _fu1()
IF GUICtrlRead($combo1) = "key two" Then _fu2()
EndSwitch
WEnd
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------
;BUTTONS----------------------------------------------------------------------------------------------------------------------------------------------------------
Func _createButtons()
GUICtrlSetState($hgui, $GUI_DISABLE)
global $combo1 = GUICtrlCreateCombo ("Scripte", 300, 557, 150, 120)
global $btnStart = GUICtrlCreateButton("🟥", 450, 557, 23, 23)
Local $aTest[5][4] = [[4, 0], ["Key One", "V1"], ["Key Two", "V2"], ["Key three", "V3"], ["Key four", "V4"]]
Local $sTest = ""
;Inhalt Combobox
For $i = 1 To $aTest[0][0]
$sTest &= "|" & $aTest[$i][0]
Next
GUICtrlSetData($Combo1, $sTest)
EndFunc
;----------------------------------------------------------------------------------------------------------------------------------------------------------------
;GUI STYLE--------------------------------------------------------------------------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Func RBoxCreate($Title, $width, $height, $left = -1, $top = -1, $show = 1)
Local $GUI = GUICreate($Title, $width, $height, $left, $top, $WS_POPUP)
GUICtrlCreatePic('C:\Windows\Temp\hg.bmp', 0, 25, 920, 660)
;GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetBkColor($GUIBKCOLOR, $GUI)
_GuiRoundCorners($GUI,0,0,$ROUNDES,$ROUNDES)
$RBOX_EVENT_CLOSE = GUICtrlCreateLabel('X', $width - 20, 3, 25, 25)
GUICtrlSetCursor($RBOX_EVENT_CLOSE, 0)
GUICtrlSetBkColor($RBOX_EVENT_CLOSE, -2)
GUICtrlSetFont($RBOX_EVENT_CLOSE, 15, 800)
GUICtrlSetColor($RBOX_EVENT_CLOSE, 0x555555)
$Title &= " "
Local $hTitle = GUICtrlCreateLabel($Title, 0, 0, $width - 20, 26, $SS_CENTER, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetFont($hTitle, 17, 400, 0, "Consolas")
GUICtrlSetBkColor($hTitle, -2)
Local $Graphic = GUICtrlCreateGraphic(0, 0, $width, 25)
GUICtrlSetState($Graphic, $Gui_DISABLE)
If $show = 1 Then GUISetState(@SW_SHOW, $GUI)
Return $GUI
EndFunc
Func CheckX($hGui, $CtrlID, $sCMD, $eCMD)
Local $cGui = GUIGetCursorInfo($hGui)
If Not IsArray($cGui) Then
Return 0
EndIf
If $LastHwnd <> $cGui[4] And $cGui[4] = $CtrlID Then Return Execute($sCMD) + Assign("LastHwnd", $cGui[4])
If $LastHwnd <> $cGui[4] Then Return Execute($eCMD) + Assign("LastHwnd", $cGui[4])
EndFunc
;-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
Dim $pos, $ret, $ret2
$pos = WinGetPos($h_win)
$ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3)
If $ret[0] Then
$ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)
If $ret2[0] Then
Return 1
Else
Return 0
EndIf
Else
Return 0
EndIf
EndFunc
Alles anzeigen
Einen schönen Tag noch
lg