Hallo zussammen,
Folgendes problem:
mein skript (siehe unten) soll eig nur ein Fenster aus eine ini datei berechnen und anzeigen.
Unter win xp sp3 32 bit läuft es einwandfrei, aber unter win 7 64 bit zeigt es zusätzlich noch ein konsolenfenster mit dem STDOUT-Stream meines programmes an.
sowohl ausführen im kompatibilitätsmodus als auch kompilieren für 64 bit haben nichts geändert.
Hier ist der Quellcode:
FLauncher.au3
#cs ----------------------------------------------------------------
Script Version : 0.1
Author : inventor <[email='stefan.thomas@famthomas.net'][/email]>
#ce ----------------------------------------------------------------
#region Optionen und Includes
Opt("MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)
Opt("GUIcloseonESC", 0)
Opt("GUIEventOptions", 1)
Opt("TrayIconHide", 1)
#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]#endregion Optionen und Includes
[/autoit] [autoit][/autoit] [autoit]#region Variablen
ConsoleWrite("Test 1.1")
Local $cfgfile = @scriptDir&"\config.ini"
If $CmdLine[0] > 0 Then
$cfgfile=escape($CmdLine[1])
;MsgBox(0, "FLauncher - Init", $CmdLine[0]&@CRLF&$CmdLine[1]&@CRLF&$cfgfile)
EndIf
If(Not FileExists($cfgfile))Then
MsgBox(0+48+4096, "Flauncher - Error", "The config-File '"&$cfgfile&"' could not be found."&@CRLF&"FLauncher will now exit")
EndIf
Global $GUI
Local $msg
Global $rows
Global $cols
Global $title
Global $x
Global $y
Local $_x
Local $_col
Local $_y
Local $_row
Global $sections = IniReadSectionNames($cfgfile)
#endregion Variablen
#endregion
#region Initialisierung
load()
[/autoit] [autoit][/autoit] [autoit]$GUI = GUICreate($title, $cols*100+10, $rows*100+10, $x, $y)
GUISetOnEvent($GUI_EVENT_CLOSE, "ende")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "minimize")
GUISetOnEvent($GUI_EVENT_RESTORE, "restore")
$_col = 0
$_row = 1
For $i = 1 To UBound($sections)-2
if($_col >= $cols) Then
$_row = $_row+1
$_col = 0
EndIf
$_col = $_col+1
$_x = 10*$_col+(90*($_col-1))
$_y = 10*$_row+(90*($_row-1))
;MsgBox(0, "FLauncher - Init", "createButton( '"&$sections[$i+1]&"', "&$_x&"("&$_col&"), "&$_y&"("&$_row&"))")
GUIctrlSetOnEvent(GUICtrlCreateButton($sections[$i+1], $_x, $_Y, 90, 90), "exec")
Next
GUISetState(@SW_SHOW, $GUI)
#endregion Initialisierung
#endregion
#region Hauptprogramm
[/autoit] [autoit][/autoit] [autoit]While 1
sleep(100)
WEnd
#endregion Hauptprogramm
[/autoit] [autoit][/autoit] [autoit]#region Funktionen
Func escape($string)
Local $str = StringReplace($String, "%%", "%1")
$str = StringReplace($str, "%desktop", @DesktopDir)
$str = StringReplace($str, "%script", @ScriptDir)
Return StringReplace($str, "%1", "%")
EndFunc
Func exec()
Local $name = GUICtrlRead(@GUI_CtrlId)
Local $file = escape(read($name, "file"))
If(Not FileExists($file)) Then
MsgBox(0+48+4096, "FLauncher - Error", "Invalid file for '"&$name&"'"&@CRLF&$file)
ende()
EndIf
Local $params = escape(read($name, "params"))
Local $workingdir = escape(read($name, "workingdir"))
;MsgBox(0, "FLauncher - exec", "ShellExecute("&$file&", "&$params&", "&$workingdir&")")
ShellExecute($file, $params, $workingdir)
EndFunc
Func load()
$rows = read("Window", "rows", 1)
$cols = read("Window", "cols", 1)
If($rows < 0 Or $cols < 0) Then
MsgBox(0+48+4096, "FLauncher - Error", "There is an error in your configuration file")
Exit
EndIf
$title = read("Window", "title")
$x = read("Window", "x", -1)
$y = read("Window", "y", -1)
EndFunc
Func read($sec, $key, $def="")
return IniRead($cfgfile, $sec, $key, $def)
EndFunc
Func write($sec, $key, $val)
IniWrite($cfgfile, $sec, $key, $val)
EndFunc
Func savepos()
Local $pos = WinGetPos($GUI)
if ($pos[0] >= 0 AND $pos[1] >= 0) Then
write("Window", "x", $pos[0])
write("Window", "y", $pos[1])
;MsgBox(0, "FLauncher - savepos", "position saved")
EndIf
EndFunc
Func minimize()
savepos()
GUISetState(@SW_MINIMIZE, $GUI)
EndFunc
Func restore()
GUISetState(@SW_RESTORE, $GUI)
EndFunc
Func ende()
savepos()
Exit
EndFunc
#endregion Funktionen
Da ich weder hier im forum, noch auf google was gefunden hab, hab ich nen neuen Thread aufgemacht.
Ich hoffe ihr könnt mir helfen, danke schon mal im voraus.
Sorontik