hallo ihrkleines propblem wenn ich das beispiel von bugfix , miteinem button keine probs
Spoiler anzeigen
#include <GUIConstants.au3>
Global $stat = False
$gui1 = GUICreate('GUI 1')
$btn1 = GUICtrlCreateButton('Starte Help', 10, 20, 100, 20)
GUICtrlSetBkColor($btn1, 0x00FF00)
GUISetState(@SW_SHOW, $gui1)
While 1
$msg = GUIGetMsg()
If $stat Then
If Not ProcessExists('AutoIt3Help.exe') Then
GUICtrlSetBkColor($btn1, 0x00FF00)
$stat = False
EndIf
Else
If ProcessExists('AutoIt3Help.exe') Then
GUICtrlSetBkColor($btn1, 0xFA8072)
$stat = True
EndIf
EndIf
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $btn1
ShellExecute(StringReplace(@AutoItExe, 'autoit3.exe', 'AutoIt3Help.exe'))
EndSwitch
WEnd
so erweitere
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
Global $stat = 0
$gui1 = GUICreate('GUI 1', 633, 447, 193, 125)
;$Form1 = GUICreate("", 633, 447, 193, 125)
$Btn1 = GUICtrlCreateButton("1", 104, 64, 137, 105, 0)
$Btn2 = GUICtrlCreateButton("2", 400, 64, 137, 105, 0)
$Btn3 = GUICtrlCreateButton("3", 104, 232, 137, 105, 0)
$Btn4 = GUICtrlCreateButton("4", 400, 232, 137, 105, 0)
$Btn5 = GUICtrlCreateButton("Exit", 272, 400, 89, 25, 0)
GUICtrlSetBkColor($btn1,0x00FF00)
GUICtrlSetBkColor($btn2,0x00FF00)
GUICtrlSetBkColor($btn3,0x00FF00)
GUICtrlSetBkColor($btn4,0x00FF00)
GUICtrlSetBkColor($btn5,0x00FF00)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
$pid = ProcessExists('Batch2Exe_Converter(Deutsch).exe')
If $stat <> $pid Then $stat = _ToggleBtnCol($btn1, $pid)
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $btn1
If $stat Then
ProcessClose($stat)
Else
ShellExecute("C:\Dokumente und Einstellungen\Administrator\Desktop\Batch2Exe_Converter(Deutsch).exe")
EndIf
EndSwitch
$pid = ProcessExists('AutoIt3Help.exe')
If $stat <> $pid Then $stat = _ToggleBtnCol1($btn2, $pid)
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $btn2
If $stat Then
ProcessClose($stat)
Else
ShellExecute(StringReplace(@AutoItExe, 'autoit3.exe', 'AutoIt3Help.exe'))
EndIf
EndSwitch
WEnd
Func _ToggleBtnCol1($ID, $PID)
If $PID Then
GUICtrlSetBkColor($ID, 0xFA8072)
ControlSetText($gui1, '', $ID, 'Beende Help')
Else
GUICtrlSetBkColor($ID, 0x00FF00)
ControlSetText($gui1, '', $ID, 'Starte Help')
EndIf
Return $PID
EndFunc
Func _ToggleBtnCol($ID, $PID)
If $PID Then
GUICtrlSetBkColor($ID, 0xFA8072)
ControlSetText($gui1, '', $ID, 'Beende Help')
Else
GUICtrlSetBkColor($ID, 0x00FF00)
ControlSetText($gui1, '', $ID, 'Starte Help')
EndIf
Return $PID
EndFunc
habe ich streifen im button, aber wieso