Problem mit $WS_EX_TOPMOST

  • Hi Leute,
    ich habe vor kurzem ein Task-Manager geschrieben, is ja nichts besonderes, gibt es schon mehrere, und mein Problem ist,
    dass es eine Option gibt "Immer im Vordergrund".
    Allerdings hat es keinen Effekt, wenn ich schreibe:

    [autoit]

    guictrlsetstyle($processkiller, -1, $WS_EX_TOPMOST)

    [/autoit]


    daher habe ich dies ziemlich blöd gelöst, und zwar wird das Fenster gelöscht und mit der neuen Einstellung neu aufgebaut.
    Weiss jemand woran das liegt?
    Hier nochmal der komplette Autoit-Script:

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    #include <File.au3>
    #include <GuiComboBox.au3>
    #include <GuiHeader.au3>
    #include <GuiImageList.au3>
    #include <GuiListView.au3>
    #include <GuiStatusBar.au3>
    #include <GuiTab.au3>
    #include <Inet.au3>
    #include <Process.au3>
    #include <ScreenCapture.au3>
    #include <Timers.au3>
    #include <WinAPI.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <HeaderConstants.au3>
    #include <ListViewConstants.au3>
    #include <StructureConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <String.au3>
    #include <EditConstants.au3>
    #include <Misc.au3>
    #include <GUIConstantsEx.au3>
    #Include <Constants.au3>
    #NoTrayIcon
    $alwatop = 1

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

    Global $colItems = ""

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

    Global $z = 0
    Global $t = 0
    global $trayyn = 0
    global $savepath = @DesktopDir
    global $filename = "Taskmgrinfo"
    Global $bkcolor = 0xF0F0F0
    Global $bklvcolor = 0xFFFFFF
    global $txtcolor = 0x000000
    Global $bfcolor = 0x000000
    global $butcolor = 0xF0F0F0
    global $lvgrid = 1
    ;Global $tabview = 0
    _main(1)
    Func _main($altopnot)
    #Region ### START Koda GUI section ### Form=
    if $altopnot = 1 Then
    Global $Processkiller = GUICreate("Processkiller", 600, 550, 300, 200, -1, $WS_EX_TOPMOST)
    Else
    Global $Processkiller = GUICreate("Processkiller", 600, 550, 300, 200)
    EndIf
    ;Menu----------------------
    ;Filemenu------------------
    Global $filemenu = GUICtrlCreateMenu("File")
    Global $startmenu = GUICtrlCreateMenu("Start...", $filemenu)
    Global $cmdmenu = GUICtrlCreateMenuItem("Cmd", $startmenu)
    Global $sysconmenu = GUICtrlCreateMenuItem("System control", $startmenu)
    Global $notemenu = GUICtrlCreateMenuItem("Notes", $startmenu)
    Global $resmonmenu = GUICtrlCreateMenuItem("Resourcen Monitor", $startmenu)
    Global $editormenu = GUICtrlCreateMenuItem("Editor", $startmenu)
    Global $taskmenu = GUICtrlCreateMenuItem("Task-Mgr", $startmenu)
    ;$runmenu = GUICtrlCreateMenuItem("Run", $startmenu)
    Global $openfilemenu = GUICtrlCreateMenuItem("Open File...", $filemenu)
    GUICtrlCreateMenuItem("", $filemenu)
    Global $exitmenu = GUICtrlCreateMenuItem("Exit", $filemenu)
    ;Optionmenu--------------
    Global $optionmenu = GUICtrlCreateMenu("Options")
    Global $savinfmenu = GUICtrlCreateMenuitem("Save info", $optionmenu)
    Global $showinfomenu = GUICtrlCreateMenuitem("Show info", $optionmenu)
    Global $allrefreshmenu = GUICtrlCreateMenuitem("Refresh all", $optionmenu)
    Global $settingsmenu = GUICtrlCreateMenu("Settings", $optionmenu)
    if $altopnot = 1 Then
    Global $alwatopmenu = GUICtrlCreateMenuitem("Always on top(off)", $settingsmenu)
    Else
    Global $alwatopmenu = GUICtrlCreateMenuitem("Always on top(on)", $settingsmenu)
    EndIf
    if $trayyn = 0 Then
    Global $hideminimenu = GUICtrlCreateMenuitem("Hide at Mininmize(on)", $settingsmenu)
    Else
    Global $hideminimenu = GUICtrlCreateMenuitem("Hide at Mininmize(off)", $settingsmenu)
    EndIf
    ;View-------------------
    Global $viewmenu = GUICtrlCreateMenu("View")
    Global $colormenu = GUICtrlCreateMenuitem("Colors", $viewmenu)
    Global $designmenu = GUICtrlCreateMenu("Design", $viewmenu)
    if $lvgrid = 1 Then
    global $lvdesignmenu = guictrlcreatemenuitem("Listview grid(off)", $designmenu)
    Else
    global $lvdesignmenu = guictrlcreatemenuitem("Listview grid(on)", $designmenu)
    EndIf

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

    ;if $tabview = 0 Then
    ; global $tabdesignmenu = guictrlcreatemenuitem("Tabview buttons (on)", $designmenu)
    ;Else
    ; global $tabdesignmenu = guictrlcreatemenuitem("Tabview buttons (off)", $designmenu)
    ;EndIf

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

    Global $infolabelpro = guictrlcreatelabel("", 0, 500, 100, 25)
    Global $infolabeltask = guictrlcreatelabel("", 100, 500, 100, 25)

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

    Global $infolabeldate = guictrlcreatelabel("", 300, 500, 100, 25)
    Global $allminimizebut = GUICtrlCreateButton("Minimize All", 450, 495, 150, 30, $WS_GROUP)

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

    Global $Tab1 = GUICtrlCreateTab(0, 0, 600, 490)

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

    ;if $tabview = 1 Then
    ;guictrlsetstyle($Tab1, -1, $TCS_BUTTONS )
    ;EndIf
    Global $TabSheet2 = GUICtrlCreateTabItem("Windows")

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

    Global $ListView2 = GUICtrlCreateListView("Window |ID", 10, 30, 580, 410)

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

    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview2, -1, $LVS_EX_GRIDLINES)
    EndIf

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

    Global $closelwinbut = GUICtrlCreateButton("Close selected Window", 440, 450, 150, 30, $WS_GROUP)
    Global $chantobut = GUICtrlCreateButton("Change to", 340, 450, 100, 30, $WS_GROUP)
    Global $minimizebut = GUICtrlCreateButton("Minimize", 240, 450, 100, 30, $WS_GROUP)
    Global $maximizebut = GUICtrlCreateButton("Maximize", 140, 450, 100, 30, $WS_GROUP)
    Global $refreshbut1 = GUICtrlCreateButton("Refresh", 40, 450, 100, 30, $WS_GROUP)
    Global $TabSheet1 = GUICtrlCreateTabItem("Processes")

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

    Global $ListView1 = GUICtrlCreateListView("Process |ID", 10, 30, 580, 410,"", $LVS_EX_GRIDLINES)
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview1, -1, $LVS_EX_GRIDLINES)
    EndIf
    Global $killselprobut = GUICtrlCreateButton("Kill selected Process", 440, 450, 150, 30, $WS_GROUP)
    Global $newprobut = GUICtrlCreateButton("New Process", 290, 450, 150, 30, $WS_GROUP)
    Global $moreinfobut = GUICtrlCreateButton("More Info", 140, 450, 150, 30, $WS_GROUP)
    Global $refreshbut2 = GUICtrlCreateButton("Refresh", 40, 450, 100, 30, $WS_GROUP)
    Global $TabSheet3 = GUICtrlCreateTabItem("Other Information")
    global $computerinfo = guictrlcreatelabel("", 30, 50, 200, 500)

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

    guictrlsetcolor($listview2, $txtcolor)
    guictrlsetcolor($listview1, $txtcolor)

    ;-------------------------------------------------

    guictrlsetcolor($infolabeltask, $bfcolor)
    guictrlsetcolor($infolabelpro, $bfcolor)
    guictrlsetcolor($infolabeldate, $bfcolor)
    guictrlsetcolor($allminimizebut, $bfcolor)
    guictrlsetcolor($closelwinbut, $bfcolor)
    guictrlsetcolor($chantobut, $bfcolor)
    guictrlsetcolor($minimizebut, $bfcolor)
    guictrlsetcolor($maximizebut, $bfcolor)
    guictrlsetcolor($refreshbut1, $bfcolor)
    guictrlsetcolor($killselprobut, $bfcolor)
    guictrlsetcolor($newprobut, $bfcolor)
    guictrlsetcolor($moreinfobut, $bfcolor)
    guictrlsetcolor($refreshbut2, $bfcolor)
    guictrlsetcolor($computerinfo, $bfcolor)

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

    ;---------------------------------------------------

    guisetbkcolor($bkcolor)


    ;---------------------------------------------------

    guictrlsetbkcolor($listview2, $bklvcolor)
    guictrlsetbkcolor($listview1, $bklvcolor)

    ;--------------------------------------------------

    guictrlsetbkcolor($allminimizebut, $butcolor)
    guictrlsetbkcolor($closelwinbut, $butcolor)
    guictrlsetbkcolor($chantobut, $butcolor)
    guictrlsetbkcolor($minimizebut, $butcolor)
    guictrlsetbkcolor($maximizebut, $butcolor)
    guictrlsetbkcolor($refreshbut1, $butcolor)
    guictrlsetbkcolor($killselprobut, $butcolor)
    guictrlsetbkcolor($newprobut, $butcolor)

    guictrlsetbkcolor($refreshbut2, $butcolor)
    GUISetState(@SW_SHOW)
    Opt("WinTitleMatchMode", 2)
    #EndRegion ### END Koda GUI section ###

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

    GUICtrlSetData($computerinfo, "Computername:" & @ComputerName & @CRLF & "System:" & @OSVersion & @CRLF & "Servicepack:" & @OSServicePack & @CRLF & "Bit:" & @osArch & @CRLF & "Benutzername:" & @UserName & @CRLF & "System:" & @SystemDir & @CRLF & "Windows:" & @WindowsDir & @CRLF & "Temp:" & @TempDir & @CRLF & "Appdata:" & @AppDataDir & @CRLF & "Logonserver:" & @LogonServer & @CRLF & "Logondomain:" & @LogonDomain & @CRLF & "LogonDNSdomain:" & @LogonDNSDomain)

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

    _processload()
    _taskload()

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

    Case $GUI_EVENT_CLOSE
    Exit

    Case $newprobut
    _newprocess()

    Case $killselprobut
    _killprocess(guictrlread($listview1))
    Case $moreinfobut
    _moreinfo(guictrlread($listview1))
    Case $closelwinbut
    _killtask(guictrlread($listview2))
    Case $chantobut
    _changeto(guictrlread($listview2))
    Case $minimizebut
    _minimize(guictrlread($listview2))
    Case $maximizebut
    _maximize(guictrlread($listview2))
    Case $allminimizebut
    WinMinimizeAll()
    Case $refreshbut1

    _GUICtrlListView_DeleteAllItems($listview2)
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview1, -1, $LVS_EX_GRIDLINES)
    EndIf
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview2, -1, $LVS_EX_GRIDLINES)
    EndIf
    _taskload()
    Case $refreshbut2

    _GUICtrlListView_DeleteAllItems($listview1)
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview1, -1, $LVS_EX_GRIDLINES)
    EndIf
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview2, -1, $LVS_EX_GRIDLINES)
    EndIf
    _processload()
    Case $cmdmenu
    run("cmd.Exe")
    if @error then MsgBox(0, "Error", "Cmd.exe does not exists",262144)
    Case $editormenu
    run("notepad.exe")
    if @error then MsgBox(0, "Error", "Editor does not exists", 262144)
    Case $Taskmenu
    run("taskmgr.exe")
    if @error then MsgBox(0, "Error", "Task manager does not exists", 262144)
    Case $notemenu
    run("Stikynot.exe")
    if @error then MsgBox(0, "Error", "Notes does not exists", 262144)
    Case $resmonmenu
    run("resmon.exe")
    if @error then MsgBox(0, "Error", "Rescourcen Monitor does not exists", 262144)

    Case $sysconmenu
    run("control.exe")
    if @error then MsgBox(0, "Error", "System control does not exists", 262144)
    Case $openfilemenu
    run("explorer.exe")
    if @error then MsgBox(0, "Error", "Explorer does not exists", 262144)
    Case $exitmenu
    Exit
    Case $savinfmenu
    _infowrite($savepath, $filename)
    Case $showinfomenu
    _showinfo()
    Case $allrefreshmenu
    _allrefresh()
    Case $alwatopmenu
    if $alwatop = 0 Then
    guidelete($processkiller)

    $alwatop = 1
    exitloop
    Else
    guidelete($processkiller)
    $alwatop = 0
    exitloop
    EndIf
    Case $hideminimenu
    if $trayyn = 0 Then
    guictrlsetdata($hideminimenu, "Hide at Mininmize(off)")
    $trayyn = 1
    Else
    guictrlsetdata($hideminimenu, "Hide at Mininmize(on)")
    $trayyn = 0
    EndIf
    case $GUI_EVENT_MINIMIZE
    if $trayyn = 1 Then
    minimizetray()
    Else
    guisetstate(@SW_MINIMIZE)
    EndIf

    case $colormenu
    _color()
    ; case $tabdesignmenu
    ; if $tabview = 1 Then
    ; guictrlsetdata($tabdesignmenu, "Tabview buttons (on)")
    ; guictrlsetstyle($tab1, -1, "")
    ; $tabview = 0
    ; Else
    ; guictrlsetdata($tabdesignmenu, "Tabview buttons (off)")
    ; guictrlsetstyle($Tab1, -1, $TCS_BUTTONS )
    ; $tabview = 1
    ; EndIf
    case $lvdesignmenu
    if $lvgrid = 1 Then
    guictrlsetdata($lvdesignmenu, "Listview grid (on)")
    guictrlsetstyle($Listview2, -1, "")
    guictrlsetstyle($Listview1, -1, "")
    $lvgrid = 0
    Else
    guictrlsetdata($lvdesignmenu, "Listview grid (off)")
    guictrlsetstyle($Listview2, -1, $LVS_EX_GRIDLINES)
    guictrlsetstyle($Listview1, -1, $LVS_EX_GRIDLINES)
    $lvgrid = 1
    EndIf
    EndSwitch

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

    guictrlsetdata($infolabeldate, "Date: "&_now())
    sleep(40)
    timecheck()
    WEnd
    if $altopnot = 1 Then
    _main(0)
    Else
    _main(1)
    EndIf

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

    EndFunc
    Func _processload()
    $y = 1
    global $allprocess = ProcessList()
    Global $Processid[$allprocess[0][0] +1]
    for $i = 1 to $allprocess[0][0]
    if StringInStr($allprocess[$i][0], ".exe") then

    guictrlcreatelistviewitem($allprocess[$i][0]&"|"&$allprocess[$i][1], $listview1)
    $y += 1
    EndIf
    Next
    guictrlsetdata($infolabelpro, "Processes: "&$y - 1)
    EndFunc

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

    Func _newprocess()
    $manualbrowse = MsgBox(3, "Path or browse", "Do you want to browse the *.exe you want to execute? Otherwise you can type in the path manually",262144)
    if $manualbrowse = 2 Then

    ElseIf $manualbrowse = 7 Then
    $input = inputbox("New Process", "Type in path of new process")
    run($input)
    Else
    $input = FileOpenDialog("Open *.exe you want", "C:\", "executable (*.exe)")
    run($input)
    EndIf

    if @error Then
    msgBox(0, "Error", "Nothing run", 262144)
    EndIf
    EndFunc

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

    Func _killprocess($process)
    if $process = 0 Then
    MsgBox(0, "Error", "No process is selected!", 262144)
    Else
    $killingpro = stringsplit(guictrlread(guictrlread($listview1)), "|")
    processclose($killingpro[1])
    if @error then MsgBox(0, "Error", "Error killing Process", 262144)
    _GUICtrlListView_DeleteAllItems($listview1)
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview1, -1, $LVS_EX_GRIDLINES)
    EndIf
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview2, -1, $LVS_EX_GRIDLINES)
    EndIf
    _processload()
    EndIf
    EndFunc

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

    Func _moreinfo($process)
    if $process = 0 Then
    MsgBox(0, "Error", "No process is selected!", 262144)
    Else
    $infopro = stringsplit(guictrlread(guictrlread($listview1)), "|")

    $mem = ProcessGetStats($infopro)
    if ubound($mem) < 1 then

    Else
    $IO = ProcessGetStats($infopro[1], 1)
    if ubound($IO) < 5 Then
    Else
    MsgBox(0, "Information", "WorkingSetSize: "&$mem[0]&@CRLF&"PeakWorkingSetSize: "&$mem[1]&@CRLF&"Read operations: "&$IO[0]&@CRLF&"Write operations: "&$IO[1]&@CRLF&"Not read/write I/O operations: "&$IO[2]&@CRLF&"Readed Bytes: "&$IO[3]&@CRLF&"Written Bytes: "&$IO[4]&@CRLF&"Transferred Bytes not through Write/Read: "&$IO[5], 262144)
    EndIf
    EndIf
    EndIf
    EndFunc

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

    Func _taskload()
    global $allwindows = WinList()
    Global $Windowid[$allwindows[0][0] +1]
    $x = 1
    for $i = 1 to $allwindows[0][0]
    if $allwindows[$i][0] <> "" and isvisible($allwindows[$i][1]) then
    $windowid[$x] = $allwindows[$i][0]
    ;MsgBox(0, "test", $windowid[$x])
    guictrlcreatelistviewitem($allwindows[$i][0]&"|"&$allwindows[$i][1], $listview2)
    $x +=1
    EndIf
    Next

    guictrlsetdata($infolabeltask, "Windows: "&$x-1)
    EndFunc

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

    Func _killtask($task)
    if $task = 0 Then
    MsgBox(0, "Error", "No Task is selected!", 262144)
    Else
    $killingtask = stringsplit(guictrlread(guictrlread($listview2)), "|")
    winclose($killingtask[1])
    if @error then MsgBox(0, "Error", "Error closing Task", 262144)
    $task = $task - 110
    ;MsgBox(0, "tesT", guictrlread($listview2))

    ;MsgBox(0, "Killed", $windowid[$task])

    _GUICtrlListView_DeleteAllItems($listview2)
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview1, -1, $LVS_EX_GRIDLINES)
    EndIf
    if $lvgrid = 1 Then
    GUICtrlSetStyle($listview2, -1, $LVS_EX_GRIDLINES)
    EndIf
    _taskload()
    EndIf
    EndFunc

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

    Func _changeto($task)
    if $task = 0 Then
    MsgBox(0, "Error", "No Task is selected!", 262144)
    Else
    $chantask = stringsplit(guictrlread(guictrlread($listview2)), "|")
    Winactivate($chantask[1])
    if @error Then Exit
    EndIf
    EndFunc

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

    Func _minimize($task)
    if $task = 0 Then
    MsgBox(0, "Error", "No Task is selected!", 262144)
    Else
    $minitask = stringsplit(guictrlread(guictrlread($listview2)), "|")
    WinSetState($minitask[1], "", @SW_MINIMIZE)
    if @error Then Exit
    EndIf
    EndFunc

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

    Func _maximize($task)
    if $task = 0 Then
    MsgBox(0, "Error", "No Task is selected!" , 262144)
    Else
    $maxitask = stringsplit(guictrlread(guictrlread($listview2)), "|")
    WinSetState($maxitask[1], "", @SW_MAXIMIZE)
    if @error Then Exit
    EndIf
    EndFunc

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

    Func IsVisible($handle)
    If BitAnd( WinGetState($handle), 2 ) Then
    Return 1
    Else
    Return 0
    EndIf

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

    EndFunc

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

    Func _allrefresh()
    Check()

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

    _GUICtrlListView_DeleteAllItems($listview2)

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

    _taskload()
    _GUICtrlListView_DeleteAllItems($listview1)

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

    _processload()
    EndFunc

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

    Func Check()

    GUICtrlSetData($computerinfo, "Computername:" & @ComputerName & @CRLF & "System:" & @OSVersion & @CRLF & "Servicepack:" & @OSServicePack & @CRLF & "Bit:" & @osArch & @CRLF & "Benutzername:" & @UserName & @CRLF & "System:" & @SystemDir & @CRLF & "Windows:" & @WindowsDir & @CRLF & "Temp:" & @TempDir & @CRLF & "Appdata:" & @AppDataDir & @CRLF & "Logonserver:" & @LogonServer & @CRLF & "Logondomain:" & @LogonDomain & @CRLF & "LogonDNSdomain:" & @LogonDNSDomain)

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

    EndFunc

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

    Func timecheck()
    $z += 1
    if $z = 50 then
    check()
    $z = 0
    EndIf
    EndFunc

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

    Func _infowrite($path, $name)
    $info = "Date: "&_now()&@crlf&@crlf&"General Information"&@CRLF&@crlf
    $info = $info&guictrlread($computerinfo)&@crlf&@crlf
    $info = $info&"Battery Information"&@CRLF&@crlf
    $info = $info&guictrlread($batteryinfo)&@CRLF&@crlf
    $info = $info&guictrlread($infolabeltask)&@CRLF
    for $i = 1 to $allwindows[0][0]
    if $allwindows[$i][0] <> "" and isvisible($allwindows[$i][0]) Then
    $info = $info&$allwindows[$i][0]&" "&$allwindows[$i][1]&@CRLF
    EndIf
    Next
    $info = $info&@CRLF
    $info = $info&guictrlread($infolabelpro)&@CRLF
    for $i = 1 to $allprocess[0][0]
    if stringinstr($allprocess[$i][0], ".exe") then
    $info = $info&$allprocess[$i][0]&" "&$allprocess[$i][1]&@CRLF
    EndIf
    Next

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

    $nameyn = MsgBox(3, "Filename", "Save as "&$name&"?", 262144)
    if $nameyn = 2 Then

    Else

    if $nameyn = 7 Then
    $name = inputbox("Filename", "Type in the Filename you want")
    Else

    EndIf
    $pathyn = MsgBox(3, "Path", "Save under "&$path&"?", 262144)
    if $pathyn = 2 Then
    Else
    if $pathyn = 7 Then
    $path = inputbox("Path", "Type in the Path you want")
    Else

    EndIf
    if stringright($path, 1) = "\" then
    $file = fileopen($path&$name&".taskinf", 10)
    Else
    $path = $path&"\"
    $file = fileopen($path&$name&".taskinf", 10)
    EndIf
    if @error then Exit
    $u = filewrite($file, $info)
    if @error or $u = 0 Then
    MsgBox(0, "Error", "Unable to save", 262144)
    Else
    MsgBox(0, "Saved", "File saved under "&$path&" as "&$name&".", 262144)
    global $savepath = $path
    global $filename = $name
    EndIf
    fileclose($file)
    EndIf
    EndIf
    EndFunc

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

    Func _showinfo()
    $open = FileOpenDialog("open Info", $savepath&$filename, "Task-mgr infos (*.taskinf)")
    if $open <> "" then
    $openform = guicreate("Information", 500, 400, @DesktopWidth/2-250,@DesktopHeight/2-200 )
    $input = guictrlcreateedit("", 0, 0, 500, 400)

    guisetstate(@sw_show)
    $infile = fileopen($open, 0)
    if @error Then msgBox(0, "Error", "Can not read file", 262144)
    guictrlsetdata($input, fileread($infile))
    while 1
    $ymsg = GUIGetMsg(1)
    if $ymsg[0] = $GUI_EVENT_CLOSE and $ymsg[1] = $openform Then
    fileclose($infile)
    guidelete($openform)
    ExitLoop

    EndIf
    WEnd

    Else
    EndIf
    EndFunc

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

    Func _settings()

    $openform = guicreate("Information", 400, 500, @DesktopWidth/2-250,@DesktopHeight/2-200 )


    guisetstate(@sw_show)
    $infile = fileopen($open, 0)
    if @error Then msgBox(0, "Error", "Can not read file")
    guictrlsetdata($input, fileread($infile))
    while 1
    $ymsg = GUIGetMsg(1)
    if $ymsg[0] = $GUI_EVENT_CLOSE and $ymsg[1] = $openform Then
    fileclose($infile)
    guidelete($openform)
    ExitLoop

    EndIf
    WEnd

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

    EndFunc

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

    func minimizetray()
    GUISetState(@SW_HIDE)
    Opt("TrayIconHide", 0)
    opt("TrayMenuMode", 1)
    TraySetClick(0)
    while 1
    $asmsg = traygetmsg()
    switch $asmsg
    case $TRAY_EVENT_PRIMARYDOUBLE

    guisetstate(@sw_show)

    ExitLoop
    EndSwitch
    WEnd
    Opt("TrayIconHide", 1)
    EndFunc

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

    Func _color()

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

    $colorform = guicreate("Color", 300, 450, @DesktopWidth/2-250,@DesktopHeight/2-200, -1, $WS_EX_TOPMOST)
    guictrlcreategroup("Color of textes", 10, 20, 280, 160)
    GUICtrlCreateLabel("Choose color for Textes in the Listviews and the Infotext", 20, 40, 200, 25)
    $lvtextbut = GUICtrlCreateButton("Choose color", 20, 70, 200, 30, $WS_GROUP)
    $preview1 = guictrlcreategraphic(230, 70, 50, 30)
    guictrlsetcolor(-1, 0x00000)
    guictrlsetbkcolor(-1, $txtcolor)
    GUICtrlCreateLabel("Choose color for Textes in Buttons & Flags", 20, 110, 200, 25)
    $bftextbut = GUICtrlCreateButton("Choose color", 20, 140, 200, 30, $WS_GROUP)
    $preview2 = guictrlcreategraphic(230, 140, 50, 30)
    guictrlsetcolor(-1, 0x00000)
    guictrlsetbkcolor(-1, $bfcolor)
    guictrlcreategroup("Color of Backgrounds", 10, 220, 280, 230)
    GUICtrlCreateLabel("Choose color for Background", 20, 240, 200, 25)
    $bkcolbut = GUICtrlCreateButton("Choose color", 20, 270, 200, 30, $WS_GROUP)
    $preview3 = guictrlcreategraphic(230, 270, 50, 30)
    guictrlsetcolor(-1, 0x00000)
    guictrlsetbkcolor(-1, $bkcolor)
    GUICtrlCreateLabel("Choose color for Background in Listview", 20, 310, 200, 25)
    $bklvbut = GUICtrlCreateButton("Choose color", 20, 340, 200, 30, $WS_GROUP)
    $preview4 = guictrlcreategraphic(230, 340, 50, 30)
    guictrlsetcolor(-1, 0x00000)
    guictrlsetbkcolor(-1, $bklvcolor)
    GUICtrlCreateLabel("Choose color for Background for Buttons", 20, 380, 200, 25)
    $bkbutbut = GUICtrlCreateButton("Choose color", 20, 410, 200, 30, $WS_GROUP)
    $preview5 = guictrlcreategraphic(230, 410, 50, 30)
    guictrlsetcolor(-1, 0x00000)
    guictrlsetbkcolor(-1, $butcolor)

    guisetstate(@sw_show)
    $newcolor1 = $txtcolor
    $newcolor2 = $bfcolor
    $newcolor3 = $bkcolor
    $newcolor4 = $bklvcolor
    $newcolor5 = $butcolor
    while 1
    $zmsg = GUIGetMsg(1)
    if $zmsg[0] = $GUI_EVENT_CLOSE and $zmsg[1] = $colorform Then
    Global $bkcolor = $newcolor3
    Global $bklvcolor = $newcolor4
    global $txtcolor = $newcolor1
    Global $bfcolor = $newcolor2
    global $butcolor = $newcolor5
    guidelete($colorform)

    guictrlsetcolor($listview2, $txtcolor)
    guictrlsetcolor($listview1, $txtcolor)
    guictrlsetcolor($computerinfo, $bfcolor)
    ;-------------------------------------------------
    guictrlsetcolor($infolabelpro, $bfcolor)
    guictrlsetcolor($infolabeltask, $bfcolor)
    guictrlsetcolor($infolabeldate, $bfcolor)
    guictrlsetcolor($allminimizebut, $bfcolor)
    guictrlsetcolor($closelwinbut, $bfcolor)
    guictrlsetcolor($chantobut, $bfcolor)
    guictrlsetcolor($minimizebut, $bfcolor)
    guictrlsetcolor($maximizebut, $bfcolor)
    guictrlsetcolor($refreshbut1, $bfcolor)
    guictrlsetcolor($killselprobut, $bfcolor)
    guictrlsetcolor($newprobut, $bfcolor)
    guictrlsetcolor($moreinfobut, $bfcolor)
    guictrlsetcolor($refreshbut2, $bfcolor)

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

    ;---------------------------------------------------

    guisetbkcolor($bkcolor)

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


    ;---------------------------------------------------

    guictrlsetbkcolor($listview2, $bklvcolor)
    guictrlsetbkcolor($listview1, $bklvcolor)

    ;--------------------------------------------------

    guictrlsetbkcolor($allminimizebut, $butcolor)
    guictrlsetbkcolor($closelwinbut, $butcolor)
    guictrlsetbkcolor($chantobut, $butcolor)
    guictrlsetbkcolor($minimizebut, $butcolor)
    guictrlsetbkcolor($maximizebut, $butcolor)
    guictrlsetbkcolor($refreshbut1, $butcolor)
    guictrlsetbkcolor($killselprobut, $butcolor)
    guictrlsetbkcolor($newprobut, $butcolor)
    guictrlsetbkcolor($moreinfobut, $butcolor)
    guictrlsetbkcolor($refreshbut2, $butcolor)


    ExitLoop

    EndIf
    Switch $zmsg[0]
    case $lvtextbut
    $newcolor1 = _choosecolor(2)
    GUICtrlSetBkColor($preview1, $newcolor1)
    case $bftextbut
    $newcolor2 = _choosecolor(2)
    GUICtrlSetBkColor($preview2, $newcolor2)
    case $bkcolbut
    $newcolor3 = _choosecolor(2)
    GUICtrlSetBkColor($preview3, $newcolor3)
    case $bklvbut
    $newcolor4 = _choosecolor(2)
    GUICtrlSetBkColor($preview4, $newcolor4)
    case $bkbutbut
    $newcolor5 = _choosecolor(2)
    GUICtrlSetBkColor($preview5, $newcolor5)
    EndSwitch
    WEnd

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

    EndFunc

    [/autoit]

    Danke im Vorraus!