1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. sc4ry

Beiträge von sc4ry

  • MemGetStatus

    • sc4ry
    • 8. Juni 2007 um 12:36

    daran hatte ich auch schon gedacht. was aber, wenn ich paar änderungen vorgenommen habe und es damit erledigt ist.

    würde er immer den explorer neustarten, obwohl es nicht nötig ist.
    oder ich muss es immer manuell aus dem autostart nehmen.

    gibts nichts anderes?

  • @exitmethod

    • sc4ry
    • 8. Juni 2007 um 11:13

    ah ok, eine weitere funktion, gut zu wissen, dank dir =)

  • MemGetStatus

    • sc4ry
    • 8. Juni 2007 um 11:09

    je höher der verbrachte speicher, desto höher die cpu-auslastung.
    und da memgetstatus[0] den prozentualen wert ausgibt, dachte ich mir, ist es das was ich suche.

    ursache werde ich bei gelgenheit raussuchen, aber sofern der explorer 1 mal neugestartet wurde, zickt der auch nicht mehr rum. daher kann ich damit noch gut leben. nur hätte ich gerne, dass zumindest der neustart des explorers automatisch geht.

    gibts dann was ähnliches, dass ich nutzen kann?

  • MemGetStatus

    • sc4ry
    • 8. Juni 2007 um 10:39

    ich hab noch ein prob.
    mein rechner hat nach dem boot immer eine auslastung von über 90%.
    die wird vom explorer verursacht, aber erst nach ca. 30 sek.

    deswegen (weil ich nicht formatieren will), wollte ich ein script schreiben, dass wartet bis die auslastung des pc über 90% geht, explorer.exe killt und neu startet.

    dazu nutze ich MemGetStatus und anschließend array[0].
    dort werden mir aber immer werte um die 50, auf einem anderen pc von 70-80 angezeigt, die cpu-aulastung ist jedoch bei 5-10.
    hab ich irgendwo einen denkfehler?

    ansonsten funktioniert das killen und restarten des explorer

    [autoit]

    $mem = MemGetStats()

    While $mem[0] < 90
    $mem = MemGetStats()
    Sleep(1)
    ;MsgBox(0, "", $mem[0])
    WEnd

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

    ProcessClose("explorer.exe")
    ProcessWaitClose("explorer.exe")
    Run(@ComSpec & " /c explorer.exe", "", @SW_HIDE)
    Exit

    [/autoit]
  • GUI+TAB+EDIT+PIC

    • sc4ry
    • 8. Juni 2007 um 10:29

    hiho,

    generelle frage:

    ist es möglich, in einer editbox, bzw dahinter und die editbox ist durchsichtig, ein transparentes pic anzeigen zu lassen, man jedoch trotzdem die ganze editbox nutzen kann?

  • @exitmethod

    • sc4ry
    • 8. Juni 2007 um 10:25

    hiho,

    hab ein kleines script geschrieben, was die shutdown/logoff-zeiten speichern soll, damit man sehen kann, wann der pc runtergefahren wurde.
    leider funzt dort jedoch @errormethod nicht richtig.

    beende ich das script im systray, via shutdown oder logoff klappt es. beende ich es jedoch per hotkeyset, kommt die meldung:

    ==> Unknown macro.:
    $close = @exitMethod
    $close = ^ ERROR

    weiss jmd warum?

    Spoiler anzeigen
    [autoit]

    Local $date = @YEAR & "-" & @MON & "-" & @MDAY
    Local $log = @UserName&"_log.html"
    HotKeySet( "^{F9}", "Terminate")
    opt("OnExitFunc", "Terminate")

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

    FileWrite($log,"")
    FileOpen($log, 1)
    Sleep(100)

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

    While 1
    Sleep(1)
    WEnd

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

    Func Terminate()
    $close = @exitMethod
    If $close = 0 Then
    FileWrite($log, "<br><BR>" & "<b>[" & @YEAR & "." & @MON & "." & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & '] "</b><br>' & "<font color=#FF0000 style=font-size:9px><b>[[[Natural Shutdown]]]</b></font>")
    ElseIf $close = 1 Then
    FileWrite($log, "<br><BR>" & "<b>[" & @YEAR & "." & @MON & "." & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & '] "</b><br>' & "<font color=#FF0000 style=font-size:9px><b>[[[Exit Function]]]</b></font>")
    ElseIf $close = 2 Then
    FileWrite($log, "<br><BR>" & "<b>[" & @YEAR & "." & @MON & "." & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & '] "</b><br>' & "<font color=#FF0000 style=font-size:9px><b>[[[Systray Shutdown]]]</b></font>")
    ElseIf $close = 3 Then
    FileWrite($log, "<br><BR>" & "<b>[" & @YEAR & "." & @MON & "." & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & '] "</b><br>' & "<font color=#FF0000 style=font-size:9px><b>[[[Logoff]]]</b></font>")
    ElseIf $close = 4 Then
    FileWrite($log, "<br><BR>" & "<b>[" & @YEAR & "." & @MON & "." & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & '] "</b><br>' & "<font color=#FF0000 style=font-size:9px><b>[[[ Shutdown]]]</b></font>")
    EndIf
    FileClose($log)
    Exit
    EndFunc ;==>Terminate

    [/autoit]
  • Gui Probleme

    • sc4ry
    • 7. Juni 2007 um 17:36

    hiho, folgendes prob ist mir aufgefallen =)

    die animation klappt beim hauptfenster immer ohne probs, nur mit den anderen nicht. diese "childs" werden jedoch standardmäßig transparent angezeigt, verblassen aber nicht.

    wie ich schon sagte, wenn ich die "childs" nochmal aufrufe, klappt das verblassen, jedoch werden diese dann auch nicht transparent angezeigt (wie mir gerade auffiel).
    können die nicht beides? bzw warum werden sie beim ersten mal transparent angezeigt und beim 2ten mal nicht?

    hier mal der code

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    ;
    ;S.T.A.R.T.E.R V.3
    ;

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

    ;© sc4ry

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

    ;Settings
    #NoTrayIcon
    #include<guiconstants.au3>
    #include <string.au3>
    #include <IE.au3>

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

    $script = "S.T.A.R.T.E.R"
    $ini = ($script & "-Settings.ini")
    $pwkey = "*"

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

    ;commandline parameters
    If $CmdLine[0] > 0 Then
    Call("_cmd")
    Else
    ;If ini exist
    If FileExists(@scriptdir & "\" & $ini) Then
    call("_INIExist")
    ;If ini does not exist
    Else
    call("_OldIniExist")
    EndIf
    EndIf

    Func _cmd()
    Select
    Case $CmdLine[1] = "-help"
    call("_help")
    Case $CmdLine[1] = "-open" or $CmdLine[1] = "-edit"
    call("_OldIniExist")
    Case $CmdLine[1] = "-renew" or $CmdLine[1] = "-new"
    FileDelete(@ScriptDir & "\" & $ini)
    call("_OldIniExist")
    Case Else
    call("_help")
    EndSelect
    EndFunc

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

    Do
    WinWaitActive("Windows herunterfahren")
    until ProcessExists("shutdown.exe")

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

    Func _INIExist()
    ;read form ini
    $portal = IniRead(@scriptdir & "\" & $ini, "Close Windows after Start", "Portal", "")
    $info = IniRead(@scriptdir & "\" & $ini, "Close Windows after Start", "HDInfo", "")
    $install = IniRead(@scriptdir & "\" & $ini, "Close Windows after Start", "Install/Error", "")
    $backup = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Notes Backup", "")
    $notes = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Lotus Notes", "")
    $shutdown = IniRead(@scriptdir & "\" & $ini, "Display before Shutdown", "Display before Shutdown", "")
    $inimsg = IniRead(@scriptdir & "\" & $ini, "Display before Shutdown", "Shutdown-Msg", "")
    $ieaxx = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "IE Access", "")
    $ieuser = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "UserID", "")
    $iepw = _StringEncrypt ( 0, IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Password", ""), $pwkey , 4 )
    $link1 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 1", "")
    $link2 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 2", "")
    $link3 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 3", "")
    $link4 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 4", "")
    $link5 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 5", "")
    $tool1 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 1", "")
    $tool2 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 2", "")
    $tool3 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 3", "")
    $tool4 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 4", "")
    $tool5 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 5", "")

    ;actions
    ;run & close generell
    If $portal = 1 Then
    WinKill("Portal")
    Else
    EndIf
    If $info = 1 Then
    WinKill("HDInfo2k")
    Else
    EndIf
    If $install = 1 Then
    WinMinimizeAll()
    ToolTip("")
    WinKill("Error")
    ControlSend("Install", "E&xit Setup", "Button2", "!x")
    WinKill("Error")
    ControlSend("Install", "E&xit Setup", "Button2", "!x")
    Else
    EndIf
    If $backup = 1 Then
    runwait(@ProgramFilesDir & "\IBM\Lotus Notes\BackupNotesData.EXE", @ProgramFilesDir & "\IBM\Lotus Notes\", @SW_HIDE)
    Else
    EndIf
    If $notes = 1 Then
    run(@ProgramFilesDir & "\IBM\Lotus Notes\notes.exe", @ProgramFilesDir & "\IBM\Lotus Notes\", @SW_MAXIMIZE)
    Else
    EndIf
    ;ie settings
    If $ieaxx = 1 Then
    $oIE = _IECreate ("https://",0,0,1,0)
    $oHWND = _IEPropertyGet($oIE, "hwnd")
    $LocationURL = _IEPropertyget($oIE, "locationurl")
    If $LocationURL = $oIE Then
    $oForm = _IEFormGetCollection ($oIE, 0)
    $oUsername = _IEFormElementGetObjByName ($oIE, "user")
    $oPassword = _IEFormElementGetObjByName ($oIE, "pass")
    _IEFormElementSetValue ($oUsername, $ieuser)
    _IEFormElementSetValue ($oPassword, $iepw)
    _IEFormSubmit ($oForm)
    Else
    EndIf
    Else
    EndIf
    If $link5 = '' Then
    Else
    $win = _IECreate ($link5, 0, 1, 1, 0)
    $oHWND = _IEPropertyGet($win, "hwnd")
    WinSetState ($oHWND, "", @SW_MAXIMIZE )
    WinSetState ($oHWND, "", @SW_SHOW )
    EndIf
    If $link4 = '' Then
    Else
    $win = _IECreate ($link4, 0, 1, 1, 0)
    $oHWND = _IEPropertyGet($win, "hwnd")
    WinSetState ($oHWND, "", @SW_MAXIMIZE )
    WinSetState ($oHWND, "", @SW_SHOW )
    EndIf
    If $link3 = '' Then
    Else
    $win = _IECreate ($link3, 0, 1, 1, 0)
    $oHWND = _IEPropertyGet($win, "hwnd")
    WinSetState ($oHWND, "", @SW_MAXIMIZE )
    WinSetState ($oHWND, "", @SW_SHOW )
    EndIf
    If $link2 = '' Then
    Else
    $win = _IECreate ($link2, 0, 1, 1, 0)
    $oHWND = _IEPropertyGet($win, "hwnd")
    WinSetState ($oHWND, "", @SW_MAXIMIZE )
    WinSetState ($oHWND, "", @SW_SHOW )
    EndIf
    If $link1 = '' Then
    Else
    $win = _IECreate ($link1, 0, 1, 1, 0)
    $oHWND = _IEPropertyGet($win, "hwnd")
    WinSetState ($oHWND, "", @SW_MAXIMIZE )
    WinSetState ($oHWND, "", @SW_SHOW )
    EndIf
    ;tool settings
    If $tool5 = '' Then
    Else
    Run(@ComSpec & ' /c "' & $tool5 & '"', "", @SW_HIDE)
    EndIf
    If $tool4 = '' Then
    Else
    Run(@ComSpec & ' /c "' & $tool4 & '"', "", @SW_HIDE)
    EndIf
    If $tool3 = '' Then
    Else
    Run(@ComSpec & ' /c "' & $tool3 & '"', "", @SW_HIDE)
    EndIf
    If $tool2 = '' Then
    Else
    Run(@ComSpec & ' /c "' & $tool2 & '"', "", @SW_HIDE)
    EndIf
    If $tool1 = '' Then
    Else
    Run(@ComSpec & ' /c "' & $tool1 & '"', "", @SW_HIDE)
    EndIf
    If $shutdown = 1 Then
    $msg = StringReplace($inimsg, "[CRLF]", @CRLF)
    Opt("OnExitFunc", "endscript")
    Else
    Exit
    EndIf
    EndFunc

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

    Func _OldIniExist()
    ;search for an old ini
    If FileExists(@scriptdir & "\S.T.A.R.T.E.R_*.ini") Then
    $path = FileChangeDir(@scriptdir)
    $ini2 = "S.T.A.R.T.E.R_*.ini"
    $search = FileFindFirstFile($ini2)
    $oldini = FileFindNextFile($search)
    ;import if found
    $portal = IniRead($oldini, "Kill on Start", "portal", "")
    $info = IniRead($oldini, "Kill on Start", "info", "")
    $install = IniRead($oldini, "Kill on Start", "install", "")
    $backup = IniRead($oldini, "Run on Start", "backup", "")
    $notes = IniRead($oldini, "Run on Start", "notes", "")
    $shutdown = IniRead($oldini, "Run End", "end", "")
    $inimsg = IniRead($oldini, "Run End", "msg", "")
    $ieaxx = 0
    $ieuser = 0
    $link1 = ""
    $link2 = ""
    $link3 = ""
    $link4 = ""
    $link5 = ""
    $tool1 = IniRead($oldini, "Own Tools", "Tool1", "")
    $tool2 = IniRead($oldini, "Own Tools", "Tool2", "")
    $tool3 = IniRead($oldini, "Own Tools", "Tool3", "")
    $tool4 = ""
    $tool5 = ""
    FileDelete($oldini)

    If FileExists(@scriptdir & "\S.T.A.R.T.E.R*.exe") Then
    $path = FileChangeDir(@scriptdir)
    $exe = "S.T.A.R.T.E.R*.exe"
    $search = FileFindFirstFile($exe)
    $killexe = FileFindNextFile($search)
    $PID = ProcessExists($killexe)
    If $PID Then ProcessClose($PID)
    ProcessWaitClose($PID)
    FileDelete(@ScriptDir & "\" & $killexe)
    Else
    EndIf

    Else
    ;declare variables if not found
    $portal = IniRead(@scriptdir & "\" & $ini, "Close Windows after Start", "Portal", "0")
    $info = IniRead(@scriptdir & "\" & $ini, "Close Windows after Start", "HDInfo", "0")
    $install = IniRead(@scriptdir & "\" & $ini, "Close Windows after Start", "Install/Error", "0")
    $backup = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Notes Backup", "0")
    $notes = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Lotus Notes", "0")
    $shutdown = IniRead(@scriptdir & "\" & $ini, "Display before Shutdown", "Display before Shutdown", "0")
    $inimsg = IniRead(@scriptdir & "\" & $ini, "Display before Shutdown", "Shutdown-Msg", "")
    $ieaxx = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "IE Access", "0")
    $ieuser = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "UserID", "")
    $link1 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 1", "")
    $link2 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 2", "")
    $link3 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 3", "")
    $link4 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 4", "")
    $link5 = IniRead(@scriptdir & "\" & $ini, "IE-Settings", "Link 5", "")
    $tool1 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 1", "")
    $tool2 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 2", "")
    $tool3 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 3", "")
    $tool4 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 4", "")
    $tool5 = IniRead(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 5", "")
    EndIf

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

    ;create maingui
    $gui = GUICreate($script & " V3", 400, 300, -1, -1, -1, $WS_EX_ACCEPTFILES)
    $ok = GUICtrlCreateButton("&OK", 40, 251, 70)
    $cancel = GUICtrlCreateButton("&Cancel", 290, 251, 70)
    $label = GUICtrlCreateLabel("© sc4ry", 160, 260)
    GUICtrlSetColor(-1, 0x9E9E9E)
    GUICtrlSetFont($label, 7)
    ;create menu
    $menu = GUICtrlCreateMenu("&More")
    $infos = GUICtrlCreateMenuitem("&Info", $menu)
    $about = GUICtrlCreateMenuitem("&About", $menu)
    ;tab 1 - start
    GUICtrlCreateTab(0, 0, 400, 245)
    GUICtrlCreateTabItem("Modify Start")
    FileInstall("Henkel2.jpg", @TempDir & "\")
    GUICtrlCreatePic(@TempDir & "\Bild.jpg", 200, 30, 180, 110)
    $IE = GUICtrlCreateButton("IE-Settings", 290, 160, 70)
    $Tools = GUICtrlCreateButton("Tool-Settings", 290, 190, 70)
    $cbportal = GUICtrlCreateCheckbox("Close Portal", 30, 40)
    GUICtrlSetTip($cbportal, "Closes the Portal if you don´t need it")
    If $portal = 1 then GUICtrlSetState($cbportal, 1)
    $cbinfo = GUICtrlCreateCheckbox("Close HDInfo-Window", 30, 70)
    GUICtrlSetTip($cbinfo, "Closes the HDInfo-Window if you don´t need it")
    If $info = 1 then GUICtrlSetState($cbinfo, 1)
    $cbinstall = GUICtrlCreateCheckbox("Close Install/Error Windows", 30, 100)
    GUICtrlSetTip($cbinstall, "Closes some Error/Install-Windows which sometimes appear")
    If $install = 1 then GUICtrlSetState($cbinstall, 1)
    GUICtrlCreateLabel("----------------------------------------------------", 30, 130)
    $cbbackup = GUICtrlCreateCheckbox("Run Lotus Notes Backup", 30, 150)
    GUICtrlSetTip($cbbackup, "Runs the Backup-my-Data-Function for Lotus Notes")
    If $backup = 1 then GUICtrlSetState($cbbackup, 1)
    $cbnotes = GUICtrlCreateCheckbox("Run Lotus Notes", 30, 180)
    GUICtrlSetTip($cbnotes, "Runs Lotus Notes (after the Backup)")
    If $notes = 1 then GUICtrlSetState($cbnotes, 1)
    ;tab 2 - shutdown
    GUICtrlCreateTab(-1, -1, 400, 245)
    GUICtrlCreateTabItem("Modify Shutdown")
    $cbshutdown = GUICtrlCreateCheckbox("Message before Shutdown", 30, 40)
    GUICtrlSetTip($cbshutdown, "Shows a MsgBox with some Information, if you Turn off, Reboot, or Logout")
    If $shutdown = 1 then GUICtrlSetState($cbshutdown, 1)
    $edit = GUICtrlCreateEdit("Put here your text you want to see before the Shutdown", 10, 70, 380, 150, $ES_AUTOVSCROLL+$ES_AUTOHSCROLL+$ES_WANTRETURN+$ES_MULTILINE)
    If $shutdown = 1 then GUICtrlSetData($edit, $inimsg)

    ;create IE-gui
    $guiie = GUICreate("IE-Settings", 300, 250)
    WinSetTrans($guiie, "", 240)
    $ok2 = GUICtrlCreateButton("&Ok", 20, 220, 70)
    $cancel2 = GUICtrlCreateButton("&Cancel", 220, 220, 70)
    ;tab 1 - access
    GUICtrlCreateTab(0, 0, 300, 215)
    GUICtrlCreateTabItem("Internet Access")
    $access = GUICtrlCreateCheckbox("automatic Internet Access Logon", 50, 40)
    If $ieaxx = 1 then GUICtrlSetState($access, 1)
    GUICtrlSetTip($access, "If you select this option, you will automaticly get access to the Internet, without writing your UserID & PW every time")
    GUICtrlCreateLabel("UserID", 50, 82, 50)
    $user = GUICtrlCreateInput("", 110, 80, 100)
    If $ieaxx = 1 then GUICtrlSetData($user, $ieuser)
    GUICtrlCreateLabel("Password", 50, 122, 50)
    $pw = GUICtrlCreateInput("", 110, 120, 100, "", $ES_PASSWORD)
    ;tab 2 - urls
    GUICtrlCreateTab(-1, -1, 300, 215)
    GUICtrlCreateTabItem("Sites to open")
    GUICtrlCreateLabel("URL 1", 10, 45)
    $link1 = GUICtrlCreateInput($link1, 50, 40, 230, 25)
    GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
    GUICtrlCreateLabel("URL 2", 10, 75)
    $link2 = GUICtrlCreateInput($link2, 50, 70, 230, 25)
    GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
    GUICtrlCreateLabel("URL 3", 10, 105)
    $link3 = GUICtrlCreateInput($link3, 50, 100, 230, 25)
    GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
    GUICtrlCreateLabel("URL 4", 10, 135)
    $link4 = GUICtrlCreateInput($link4, 50, 130, 230, 25)
    GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")
    GUICtrlCreateLabel("URL 5", 10, 165)
    $link5 = GUICtrlCreateInput($link5, 50, 160, 230, 25)
    GUICtrlSetTip(-1, "Please input here a URL, which you want to launch after the Start")

    ;create tool-gui
    $guitool = GUICreate("Tool-Settings", 300, 250, -1, -1, -1, $WS_EX_ACCEPTFILES)
    WinSetTrans($guitool, "", 240)
    $ok3 = GUICtrlCreateButton("&Ok", 20, 220, 70)
    $cancel3 = GUICtrlCreateButton("&Cancel", 220, 220, 70)
    GUICtrlCreateLabel("Here you are able to Start some own Tools", 10, 3)
    $input1 = GUICtrlCreateInput($tool1, 10, 20, 200, 25)
    GUICtrlSetState(-1, $GUI_ACCEPTFILES)
    $button1 = GUICtrlCreateButton("Browse&1", 220, 20, 70)
    $input2 = GUICtrlCreateInput($tool2, 10, 60, 200, 25)
    GUICtrlSetState(-1, $GUI_ACCEPTFILES)
    $button2 = GUICtrlCreateButton("Browse&2", 220, 60, 70)
    $input3 = GUICtrlCreateInput($tool3, 10, 100, 200, 25)
    GUICtrlSetState(-1, $GUI_ACCEPTFILES)
    $button3 = GUICtrlCreateButton("Browse&3", 220, 100, 70)
    $input4 = GUICtrlCreateInput($tool4, 10, 140, 200, 25)
    GUICtrlSetState(-1, $GUI_ACCEPTFILES)
    $button4 = GUICtrlCreateButton("Browse&4", 220, 140, 70)
    $input5 = GUICtrlCreateInput($tool5, 10, 180, 200, 25)
    GUICtrlSetState(-1, $GUI_ACCEPTFILES)
    $button5 = GUICtrlCreateButton("Browse&5", 220, 180, 70)

    ;create help-GUI
    $helpgui = GUICreate("Information", 600, 400)
    WinSetTrans($helpgui, "", 240)
    $ok4 = GUICtrlCreateButton("OK", 260, 370, 80)
    GUICtrlCreateTab(0,0, 600, 365)
    GUICtrlCreateTabItem("General")
    GUICtrlCreateEdit(@CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & "This little program will help you, to modify your systemstart and shutdown with different settings" & @CRLF & "You are also able to customize this tool, by starting your own programs", 0, 25, 597, 338, $ES_READONLY + $ES_Center)
    GUICtrlCreateTab(-1,-1, 600, 365)
    GUICtrlCreateTabItem("CommandLine")

    ;create about-gui
    $aboutgui = GUICreate("About", 200, 100)
    WinSetTrans($aboutgui, "", 240)
    $ok5 = GUICtrlCreateButton("OK", 60, 73, 80)
    GUICtrlCreateEdit(@CRLF & "This tool is written by sc4ry" & @CRLF & @CRLF & "----------- IFK 2005 -----------", 0, 0, 200, 70, $ES_READONLY + $ES_Center)

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

    ;hide
    GUISetState(@SW_HIDE, $guitool)
    ;hide
    GUISetState(@SW_HIDE, $guiie)
    ;hide
    GUISetState(@SW_HIDE, $helpgui)
    ;hide
    GUISetState(@SW_HIDE, $aboutgui)
    ;show
    GUISetState(@SW_SHOW, $gui)

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

    While 1
    $msg = GUIGetMsg(1)
    Select
    case $msg[0] = $gui_event_close And $msg[1] = $gui
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 3000, "long", 0x00090000)
    FileDelete(@ScriptDir & "\" & $ini)
    Exit
    case $msg[0] = $gui_event_close And $msg[1] = $guiie
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $guiie, "int", 3000, "long", 0x00090000)
    GUISetState(@SW_HIDE, $guiie)
    case $msg[0] = $gui_event_close And $msg[1] = $guitool
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $guitool, "int", 3000, "long", 0x00090000)
    GUISetState(@SW_HIDE, $guitool)
    case $msg[0] = $gui_event_close And $msg[1] = $helpgui
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $helpgui, "int", 3000, "long", 0x00090000)
    GUISetState(@SW_HIDE, $helpgui)
    case $msg[0] = $gui_event_close And $msg[1] = $aboutgui
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $aboutgui, "int", 3000, "long", 0x00090000)
    GUISetState(@SW_HIDE, $aboutgui)
    Case $msg[0] = $cancel And $msg[1] = $gui
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 3000, "long", 0x00090000)
    FileDelete(@ScriptDir & "\" & $ini)
    Exit
    case $msg[0] = $infos And $msg[1] = $gui
    GUISetState(@SW_SHOW, $helpgui)
    case $msg[0] = $about And $msg[1] = $gui
    GUISetState(@SW_SHOW, $aboutgui)
    case $msg[0] = $ok4 And $msg[1] = $helpgui
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $helpgui, "int", 3000, "long", 0x00090000)
    GUISetState(@SW_HIDE, $helpgui)
    case $msg[0] = $ok5 And $msg[1] = $aboutgui
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $aboutgui, "int", 3000, "long", 0x00090000)
    GUISetState(@SW_HIDE, $aboutgui)
    ;IE-Settings GUI
    case $msg[0] = $IE And $msg[1] = $gui
    GUISetState (@SW_SHOW, $guiie)
    Case $msg[0] = $cancel2 And $msg[1] = $guiie
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $guiie, "int", 3000, "long", 0x00090000)
    GUISetState(@SW_HIDE, $guiie)
    case $msg[0] = $ok2 And $msg[1] = $guiie
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $guiie, "int", 3000, "long", 0x00090000)
    If GUICtrlRead($access) = 1 Then
    IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "IE Access", "1")
    $iniuser = GUICtrlRead($user)
    $ieuser = IniWrite(@scriptdir & "\" & $ini, "IE-Settings", "UserID", $iniuser)
    $pwEncrypt = _StringEncrypt(1, GUICtrlRead($pw), $pwkey, 4)
    $iepw = IniWrite(@scriptdir & "\" & $ini, "IE-Settings", "Password", $pwEncrypt)
    Else
    IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "IE Access", "0")
    EndIf
    $inilink1 = GUICtrlRead($Link1)
    IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 1", $inilink1)
    $inilink2 = GUICtrlRead($Link2)
    IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 2", $inilink2)
    $inilink3 = GUICtrlRead($Link3)
    IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 3", $inilink3)
    $inilink4 = GUICtrlRead($Link4)
    IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 4", $inilink4)
    $inilink5 = GUICtrlRead($Link5)
    IniWrite(@ScriptDir & "\" & $ini, "IE-Settings", "Link 5", $inilink5)
    GUISetState(@SW_HIDE, $guiie)
    ;Tool-Settings GUI
    case $msg[0] = $tools And $msg[1] = $gui
    GUISetState (@SW_SHOW, $guitool)
    Case $msg[0] = $cancel3 And $msg[1] = $guitool
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $guitool, "int", 3000, "long", 0x00090000)
    GUISetState(@SW_HIDE, $guitool)
    case $msg[0] = $button1 And $msg[1] = $guitool
    $file1 = FileOpenDialog("Open File", "", "Alle (*.*)" , 1 + 2)
    GUICtrlSetData($input1, $file1)
    case $msg[0] = $button2 And $msg[1] = $guitool
    $file2 = FileOpenDialog("Open File", "", "Alle (*.*)" , 1 + 2)
    GUICtrlSetData($input2, $file2)
    case $msg[0] = $button3 And $msg[1] = $guitool
    $file3 = FileOpenDialog("Open File", "", "Alle (*.*)" , 1 + 2)
    GUICtrlSetData($input3, $file3)
    case $msg[0] = $button4 And $msg[1] = $guitool
    $file4 = FileOpenDialog("Open File", "", "Alle (*.*)" , 1 + 2)
    GUICtrlSetData($input4, $file4)
    case $msg[0] = $button5 And $msg[1] = $guitool
    $file5 = FileOpenDialog("Open File", "", "Alle (*.*)" , 1 + 2)
    GUICtrlSetData($input5, $file5)
    case $msg[0] = $ok3 And $msg[1] = $guitool
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $guitool, "int", 3000, "long", 0x00090000)
    $file1 = GUICtrlRead($input1)
    IniWrite(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 1", $file1)
    $file2 = GUICtrlRead($input2)
    IniWrite(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 2", $file2)
    $file3 = GUICtrlRead($input3)
    IniWrite(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 3", $file3)
    $file4 = GUICtrlRead($input4)
    IniWrite(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 4", $file4)
    $file5 = GUICtrlRead($input5)
    IniWrite(@scriptdir & "\" & $ini, "Run after Start", "Own-Tool 5", $file5)
    GUISetState(@SW_HIDE, $guitool)
    Case $msg[0] = $ok And $msg[1] = $gui
    DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $gui, "int", 3000, "long", 0x00090000)
    FileCreateShortcut(@AutoItExe, @StartupDir & "\" & $script & ".lnk")
    If GUICtrlRead($cbportal) = 1 Then
    IniWrite(@ScriptDir & "\" & $ini, "Close Windows after Start", "Portal", "1")
    Else
    IniWrite(@ScriptDir & "\" & $ini, "Close Windows after Start", "Portal", "0")
    EndIf
    If GUICtrlRead($cbinfo) = 1 Then
    IniWrite(@ScriptDir & "\" & $ini, "Close Windows after Start", "HDInfo", "1")
    Else
    IniWrite(@ScriptDir & "\" & $ini, "Close Windows after Start", "HDInfo", "0")
    EndIf
    If GUICtrlRead($cbinstall) = 1 Then
    IniWrite(@ScriptDir & "\" & $ini, "Close Windows after Start", "Install/Error", "1")
    Else
    IniWrite(@ScriptDir & "\" & $ini, "Close Windows after Start", "Install/Error", "0")
    EndIf
    If GUICtrlRead($cbbackup) = 1 Then
    IniWrite(@ScriptDir & "\" & $ini, "Run after Start", "Notes Backup", "1")
    Else
    IniWrite(@ScriptDir & "\" & $ini, "Run after Start", "Notes Backup", "0")
    EndIf
    If GUICtrlRead($cbnotes) = 1 Then
    IniWrite(@ScriptDir & "\" & $ini, "Run after Start", "Lotus Notes", "1")
    Else
    IniWrite(@ScriptDir & "\" & $ini, "Run after Start", "Lotus Notes", "0")
    EndIf
    If GUICtrlRead($cbshutdown) = 1 Then
    IniWrite(@ScriptDir & "\" & $ini, "Display before Shutdown", "Display before Shutdown", "1")
    $editmsg = GUICtrlRead($edit, 1)
    IniWrite(@ScriptDir & "\" & $ini, "Display before Shutdown", "Shutdown-Msg", StringReplace($editmsg, @CRLF, "[CRLF]"))
    Opt("OnExitFunc", "endscript")
    Else
    IniWrite(@ScriptDir & "\" & $ini, "Display before Shutdown", "Display before Shutdown", "0")
    Exit
    EndIf
    GUIDelete($gui)
    EndSelect
    WEnd
    EndFunc

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

    Func _Help()
    $cmdhelpgui = GUICreate("CommandLine-Help", 300, 210)
    WinSetTrans($cmdhelpgui, "", 240)
    GUICtrlCreateEdit('Possible Commands you can use:' & @CRLF & @CRLF & @CRLF & 'Renew your Settings:' & @CRLF & @CRLF & @ScriptName & ' -renew' & @CRLF & @ScriptName & ' -new' & @CRLF & @CRLF & 'Edit your existing Settings:' & @CRLF & @CRLF & @ScriptName & ' -edit' & @CRLF & @ScriptName & ' -open', 0, 0, 300, 170, $ES_READONLY + $ES_Center)
    $ok = GUICtrlCreateButton("OK", 110, 180, 80)

    GUISetState(@sw_show)

    While 1
    $msg = GUIGetMsg()
    Select
    case $msg = $gui_event_close
    Exit
    Case $msg = $ok
    Exit
    EndSelect
    WEnd
    EndFunc

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

    Func endscript()
    $inimsg = IniRead(@scriptdir & "\" & $ini, "Display before Shutdown", "Shutdown-Msg", "")
    $msg = StringReplace($inimsg, "[CRLF]", @CRLF)
    $cu = MsgBox(262144, "Remember", $msg)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit]
  • Multilanguage GUI

    • sc4ry
    • 7. Juni 2007 um 15:25

    ja, das schon, aber meine idee war

    -die erste sprache in die exe zu integrieren, da man dann wirklich nur die exe braucht, um das prog zu betreiben

    -die anderen sprachfiles stück für stück nachreichen kann (1 ini-file müsste ich immer editieren), bzw die user sich selber eine übersetzung schreiben können

    werd mich da denke ich, heute abend mal dranbegeben =)

  • Multilanguage GUI

    • sc4ry
    • 7. Juni 2007 um 15:00

    also sowas ähnliches gibt es doch schon, dass alles, was übersetzt werden soll, variabel ist (zb th.megers yaku...) und aus einer ini gelesen wird.

    neu würde hinzukommen, dass er immer prüft, ob language-files existieren (fileexist), dann deren namen ausliest (findnextfile) und nur den letzten teil erneut in einer variablen speichert (string-irgendwas).

    dann im menü alle "strings" anzeigen lassen.

    alle informationen müssten dann wiederum variabel sein und in einem array erfasst werden.

    übersetung/ auslesen könnte man ja aus älteren tools abgucken. muss noch vairabel sein, dass beim switch alle existieren menüeinträge/languagefiles beachtet werden.

    so hab ich mir das zumindest vorgestellt. den ersten teil würde ich evtl noch alleine schaffen, aber danach harperts schon =/

  • Multilanguage GUI

    • sc4ry
    • 6. Juni 2007 um 20:11

    Hey,

    ich habe mal wieder eine Idee, bin aber noch zu grün hinter den Ohren, es umzusetzen. Hab es mit dem Yak... von th.meger probiert, aber so ganz blick ich es noch nicht =(

    meine Idee:

    Ein einfach erweiterbares Multilanguage-GUI

    man startet das programm. die buttons sind variablen, jedoch im programm selber schon vordefiniert, in z.b englisch, damit man das programm jederzeit nutzen kann (ohne weitere sprachen, die in ini-dateien vorliegen)

    wird jedoch im scriptdir ein file gefunden, dass die bezeichnung "language_*.ini" hat (* ist ein platzhalter), wird automatisch ein menü eingeblendet, in der man die sprache wechseln kann. dieses menü zeigt dann den *platzhalter* an. (heisst die datei "language_german.ini", wird im menü unter language - german zur auswahl angeboten)

    über das menü kann man dann easy verschiedene sprachen aussuchen, und das gui aktualisiert sich anschließend.

    man kann also nachträglich language-ini-files erstellen, diese einfach ins scriptdir legen, wo sie nun automatisch vom programm erkannt und zur auswahl angeboten werden.

  • Gui Probleme

    • sc4ry
    • 6. Juni 2007 um 19:25

    @leviathan

    hab das prob schon selbst gefunden, als ich mir mein post nochmal durchgelesen habe. hab extra nicht das ganze script gepostet, weil ich wusste, dass der fehler irgendwo da stecken musste.

    @th.meger

    werd ich mir mal angucken.

    mit dem effekt klappt soweit ganz gut. aber teilweise macht er beim ersten mal den ablendeffekt nicht anstädnig (als ob er harkt), aber beim 2ten mal geht es richtig.
    gibts da ne erklärung, bzw ahilfe für?

    hab dllcall nun immer als ersten aufruf bei einer aufgabe.

  • shutdown abfangen möglich ?

    • sc4ry
    • 6. Juni 2007 um 18:14

    wenn der user die nachricht nicht sehen will, wobei dass anzeigen keinem weh tut, muss er max 3 klicke investieren, um sie nicht mehr zu sehen =)

    ist schon recht userfreundlich gehalten. es wird ja auch niemand dazu gezwungen es zu nutzen. aber wenn es schon jmd nutzt, dann soll die funktion aber perfekt sein =)

  • Gui Probleme

    • sc4ry
    • 6. Juni 2007 um 16:08
    Zitat

    Original von th.meger
    Hi,

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    $main_GUI = GUICreate("Main GUI", 300, 100, 10, 10)
    $b_1 = GUICtrlCreateButton("Click me 1", 10, 10, 80, 20)
    GUISetState(@SW_SHOW, $main_GUI)

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

    $child_GUI = GUICreate("Child GUI", 300, 100, 330, 10, Default, Default, $main_GUI)
    $b_2 = GUICtrlCreateButton("Click me 2", 10, 10, 80, 20)
    GUISetState(@SW_SHOW, $child_GUI)

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

    While 1
    $msg = GUIGetMsg(1)
    Select
    Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $main_GUI
    MsgBox(16, "MAIN", "Closed MAIN", 2)
    Exit(0)
    Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $child_GUI
    MsgBox(16, "CHILD", "CLOSED CHILD", 2)
    GUIDelete($child_GUI)
    Case $msg[0] = $b_1 And $msg[1] = $main_GUI
    MsgBox(16, "MAIN", "Button 1", 2)
    Case $msg[0] = $b_2 And $msg[1] = $child_GUI
    MsgBox(16, "CHILD", "Button 2", 2)
    EndSelect
    WEnd

    [/autoit]

    So long,

    Mega

    Alles anzeigen

    hierzu habe ich leider noch eine frage. leider klappt es bei mir nicht richtig, wo liegt der fehler (kein fehler beim compilieren vorhanden, jedoch reagiert kein button mehr)

    [autoit]


    ...
    $gui = GUICreate($script & " V3", 400, 300, -1, -1, -1, $WS_EX_ACCEPTFILES)
    $menu = GUICtrlCreateMenu("&More")
    $infos = GUICtrlCreateMenuitem("&Info", $menu)
    $about = GUICtrlCreateMenuitem("&About", $menu)
    ...
    ...
    $helpgui = GUICreate("Information", 600, 400, "", "", "", "", $gui)
    ...
    ...
    case $msg[0] = $infos And $msg[1] = $helpgui
    GUISetState(@SW_SHOW, $helpgui)
    ...

    [/autoit]

    PS: sorry, ich seh es jetzt schon =)
    PPS: thx euch allen =)

  • Gui Probleme

    • sc4ry
    • 6. Juni 2007 um 14:28

    sorry das ich nochmal fragen muss.
    klappen tut es ganz schön, aber nur wenn ich das gui erstelle.

    wo sieht es denn aus, wenn das beim schließen kommen soll?

  • Gui Probleme

    • sc4ry
    • 6. Juni 2007 um 14:17

    oben aufgeführtes thema ist zwar gelöst, da ich euch aber nen neuen thread ersparen will, frag ich nochmal eben hier.

    und zwar habe ich mal bei einem script gesehen, dass man das fenster, wenn es sich schließt, abblenden lassen kann. leider finde ich in der hilfe nicht, wie und wo ich was einstellen muss.

  • CMD Hilfe

    • sc4ry
    • 6. Juni 2007 um 14:00
    Zitat

    Ruft eine benutzerdefinierte Funktion auf, die in der Parameter-Zeichenkette (string parameter) angegeben wird.

    Call ( "function" )

    klappt auch einwandfrei =)

    aber thx für den tip, werd ich probieren

  • shutdown abfangen möglich ?

    • sc4ry
    • 6. Juni 2007 um 13:58

    doch, finde die idee super und werde mich baldmöglichst dransetzen.
    aber anderen sachen haben bei der programmierung gerade noch vorrang, weil es nicht lebensnotwendig ist *g*

  • variabler ProcessClose

    • sc4ry
    • 6. Juni 2007 um 13:41

    da bin ich ja bei =)

    darum soll er ja auch die alte version direkt killen und löschen

  • variabler ProcessClose

    • sc4ry
    • 6. Juni 2007 um 12:11

    richtig, der stern ist eine wildcard.
    processclose soll ähnlich wie If FileExists(@scriptdir & "\S.T.A.R.T.E.R_*.ini") Then funktionieren.

    denn hier gibt er 1 aus, wenn im ordner z.B. die datei S.T.A.R.T.E.R_V2Final.ini liegt

    wobei, da fällt mir was ein *g*

    wenn aber noch wer nen tip hat, her damit =)

    PS: umständlich aber gut =)

    [autoit]


    If FileExists(@scriptdir & "\S.T.A.R.T.E.R_*.exe") Then
    $path = FileChangeDir(@scriptdir)
    $exe = "S.T.A.R.T.E.R_*.exe"
    $search = FileFindFirstFile($exe)
    $killexe = FileFindNextFile($search)
    $PID = ProcessExists($killexe)
    If $PID Then ProcessClose($PID)
    ProcessWaitClose($PID)
    FileDelete(@ScriptDir & "\" & $killexe)
    Else
    EndIf

    [/autoit]
  • variabler ProcessClose

    • sc4ry
    • 6. Juni 2007 um 11:38

    Hiho,

    ich suche eine funktion, die mir folgends erledigt (was so einfach leider nicht geht)

    $PID = ProcessExists("S.T.A.R.T.E.R_V2*.exe")
    If $PID Then ProcessClose($PID)

    also einen process beendet, der zb S.T.A.R.T.E.R_V2.exe oder S.T.A.R.T.E.R_V2Final.exe heisst

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™