Hallo
habe mit autoit noch nicht viel erfahrung
Folgendes versuche ich:
Ich lese ein paar Registry Werte aus, vergleiche die und mache davon in Abhängigkeit ein Formular auf, das 2 Eingabefelder enthalten soll (Username, passwort). Mit Inputboxen hat das auch schon alles einwandfrei funktioniert. Mit dem Formular komme ich absolut nicht klar.
Entweder bleibt mein Fenster auf unbegrenzt stehen oder mein cwblogon Befehl in der Funktion loopt sich zu Tode.
Hier mal der Code:
#include <string.au3>
#include <GUIConstants.au3>
Run("regedit /s D:\SoftM_Start\Reg\Alkor_Suite_T0.reg")
Dim $useridout
Dim $useridin
Dim $useridstd
Dim $useridSoftm
Dim $userpass
Dim $userpassver
Dim $userpassent
Dim $userpassreg
Dim $NameAS400
Dim $DLL
Dim $Temp
Dim $FehlerCode
Dim $nMsg
Dim $start_B
$NameAS400 = RegRead("HKEY_CURRENT_USER\Software\SoftM\Global\Parametersteuerung", "System")
$useridout = RegRead("HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication", "User ID")
$useridstd = RegRead("HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication", "Signon Mode")
$useridsoftm = RegRead("HKEY_CURRENT_USER\Software\SoftM\Global\Environment", "StandardUser")
$userpassreg = RegRead ( "HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication" ,"User PW")
If ($useridsoftm = "" and $useridout = "") or ($useridsoftm = "" and $useridout <> "") Then
;Opt("GUIOnEventMode", 1) ; Wechsle in den OnEvent Modus
GUICreate("Anmeldung AS/400", 200, 200)
GUICtrlCreateLabel("AS/400 UserName:", 42, 35, 111, 17)
$useridin = GUICtrlCreateInput("", 42, 50, 121, 21)
GUICtrlCreateLabel("AS/400 Passwort:", 42, 85, 111, 17)
$userpass = GUICtrlCreateInput("", 42, 100, 121, 21)
$okbutton = GUICtrlCreateButton("OK", 70, 145, 60)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $start_B
_start($NameAS400, GUICtrlRead($useridin), GUICtrlRead($userpass))
EndSwitch
WEnd
EndIf
Func _start($NameAS400, $useridin, $userpass)
RegWrite ( "HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication" ,"User ID", "REG_SZ", $useridin)
ShellExecute("C:\Program Files\IBM\Client Access\cwblogon", " " & $NameAS400 & " /u " & $useridin & " /p " & $userpass,@SW_HIDE)
$userpassver = _StringEncrypt(1, $userpass, "passwortencrypten", 2)
RegWrite ( "HKEY_CURRENT_USER\Software\IBM\Client Access Express\CurrentVersion\Environments\My Connections\"& $NameAS400 &"\Communication" ,"User PW", "REG_SZ", $userpassver)
;ShellExecute($run, '', '', '', @SW_HIDE)
EndFunc ;==>_start
Vielleicht kann mir jemand helfen ??!??