Win 7 zeigt grundlos konsolenfenster im hintergrund an

  • 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
    [autoit]


    #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)

    [/autoit] [autoit][/autoit] [autoit]

    #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

    [/autoit] [autoit][/autoit] [autoit]

    Global $GUI
    Local $msg

    [/autoit] [autoit][/autoit] [autoit]

    Global $rows
    Global $cols
    Global $title
    Global $x
    Global $y

    [/autoit] [autoit][/autoit] [autoit]

    Local $_x
    Local $_col
    Local $_y
    Local $_row

    [/autoit] [autoit][/autoit] [autoit]

    Global $sections = IniReadSectionNames($cfgfile)
    #endregion Variablen
    #endregion
    #region Initialisierung

    [/autoit] [autoit][/autoit] [autoit]

    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")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $_col = 0
    $_row = 1

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW, $GUI)
    #endregion Initialisierung
    #endregion

    [/autoit] [autoit][/autoit] [autoit]

    #region Hauptprogramm

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    sleep(100)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    #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

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func read($sec, $key, $def="")
    return IniRead($cfgfile, $sec, $key, $def)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func write($sec, $key, $val)
    IniWrite($cfgfile, $sec, $key, $val)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    Func minimize()
    savepos()
    GUISetState(@SW_MINIMIZE, $GUI)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func restore()
    GUISetState(@SW_RESTORE, $GUI)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func ende()
    savepos()
    Exit
    EndFunc
    #endregion Funktionen

    [/autoit]


    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

    MFG inventor

    wenn's weitere Fragen gibt -> PN
    wenn da keine Antwort kommt, überdenk deine Frage noch mal

    Einmal editiert, zuletzt von inventor (21. August 2013 um 18:59)

  • Probier mal das

    [autoit]

    ConsoleWrite("Test 1.1")

    [/autoit]

    am Anfang wegzutun :D

    MfG

    There's a joke that C has the speed and efficieny of assembly language combined with readability of....assembly language. In other words, it's just a glorified assembly language. - Teh Interwebz

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, you blow off your whole leg. - Bjarne Stroustrup
    Genie zu sein, bedeutet für mich, alles zu tun, was ich will. - Klaus Kinski

  • des war nur zum testen, ob des wirklich der STDOUT is

    ich hab das problem schon gefunden, ich hatte beim kompilieren "als konsolen-anwendung" kompilieren angegeben, und unter xp nur das skript getestet

    MFG inventor

    wenn's weitere Fragen gibt -> PN
    wenn da keine Antwort kommt, überdenk deine Frage noch mal