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. Xenobiologist

Beiträge von Xenobiologist

  • ProcessClose wenn programm minimiert

    • Xenobiologist
    • 9. Februar 2012 um 15:16

    Am besten schreibst du mal in Worten auf, wie der Ablauf sein sollte. Einfach PseudoCode schreiben und dann bauen wir das in Autoit.

  • ProcessClose wenn programm minimiert

    • Xenobiologist
    • 9. Februar 2012 um 14:40

    Genau, du musst ja nur gucken, ob das Fenster welches gerade aktiv ist nicht zu dem Prozess gehört.

  • ProcessClose wenn programm minimiert

    • Xenobiologist
    • 9. Februar 2012 um 14:20
    [autoit]

    #include <Process.au3>
    Local $pid = WinGetProcess("[Active]")
    MsgBox(4096, "PID = Program", _ProcessGetName($pid))

    [/autoit]
  • msgbox/error UDF

    • Xenobiologist
    • 9. Februar 2012 um 13:09

    Viel Spaß!

    In Scite ALT+w drücken Code Wizard.

  • msgbox/error UDF

    • Xenobiologist
    • 9. Februar 2012 um 11:49

    Hallo,

    das ist natürlich noch sehr einfach.
    Aber hier ist auch noch ein kleiner Fehler

    Bei 0 kommt nur ok. In Scite gibt es übrigens eine MsgBox Hilfetool!

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

    ; Shows Message Box with buttons OK and Cancel

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

    Func OK_Cancel ($Title,$Text)

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

    Local $OK_Cancel =MsgBox(0, $Title, $Text)
    If $OK_Cancel = 2 Then abort("You pressed Cancel.")

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

    Return
    EndFunc

    [/autoit][autoit][/autoit][autoit][/autoit]
  • _Arraydisplay

    • Xenobiologist
    • 9. Februar 2012 um 10:55
    Spoiler anzeigen
    [autoit]

    #Region ;************ Includes ************
    #Include <Array.au3>
    #EndRegion ;************ Includes ************
    Global $a[3] = [1,2,3]
    _ArrayDisplay($a)
    _ArrayDisplay($a, '', '', 1)

    [/autoit]
  • Geschwindigkeit

    • Xenobiologist
    • 8. Februar 2012 um 18:08

    Gib mal ne kleine Testdatei. Das geht sicher noch schneller.

  • ISN AutoIt Studio

    • Xenobiologist
    • 8. Februar 2012 um 13:23

    Ja, ich hatte auch erhebliche Probleme mit der UDF. Ich habe sie komplett ersetzt in meinem aktuellen Projekt.
    Leider musste ich dadurch auch ein bisschen Funktionalität umgestalten.
    Aus meiner Sicht ist die buggy.

  • ISN AutoIt Studio

    • Xenobiologist
    • 8. Februar 2012 um 12:21

    Kannst du das mit einen unkomplexen Skript nachstellen, sodass man testen und experimentieren kann?

  • IPs überprüfen

    • Xenobiologist
    • 7. Februar 2012 um 19:34

    Ping ist zu langsam?
    Vielleicht nslookup?
    Oder sowas _TCPIpToName

  • Geschwindigkeit

    • Xenobiologist
    • 7. Februar 2012 um 19:27

    Alles einlesen mit FileRead und dann mit StringSplit trennen.
    Wie prüfst du denn?
    Mit Arrays oder Strings?

  • 2 Fenster-Problem

    • Xenobiologist
    • 7. Februar 2012 um 16:32
    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    $main_GUI = GUICreate("Main GUI", 300, 100, 10, 10, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))
    $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, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX), Default, $main_GUI)
    $b_2 = GUICtrlCreateButton("Click me 2", 10, 10, 80, 20)
    GUISetState(@SW_SHOW, $child_GUI)

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

    GUIRegisterMsg($WM_GETMINMAXINFO, "MY_WM_GETMINMAXINFO")

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

    Func MY_WM_GETMINMAXINFO($hWnd, $msg, $wParam, $lParam)
    If $hWnd <> $main_GUI Then Return
    $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam)
    DllStructSetData($minmaxinfo, 7, 500) ; min X
    DllStructSetData($minmaxinfo, 8, 250) ; min Y
    DllStructSetData($minmaxinfo, 9, 500) ; max X
    DllStructSetData($minmaxinfo, 10, 700) ; max Y
    Return 0
    EndFunc ;==>MY_WM_GETMINMAXINFO

    [/autoit]
  • 2 Fenster-Problem

    • Xenobiologist
    • 7. Februar 2012 um 15:50

    Hilfe -> GUIGetMsg --> Gui Message Loop.

  • Windows Media Player Objekt

    • Xenobiologist
    • 7. Februar 2012 um 13:48

    Hi,

    okay, ich gucke es mir mal an.
    Was willst du denn erreichen?
    Was soll es machen, wenn es fertig ist?
    Mega

    Spoiler anzeigen
    [autoit]

    #include <WMMedia.au3>

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

    $sFilename = FileOpenDialog("Select an MP3 File To Use.", @WorkingDir, "Mp3s(*.mp3)", 3)
    If @error Then Exit
    WMStartPlayer()
    $sObj = WMOpenFile($sFilename)
    WMPlay($sFilename)

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

    For $i = 0 To 100
    WmSetVolume(100 - $i)
    Sleep(100)
    Next
    For $i = 0 To 100
    WmSetVolume($i)
    Sleep(100)
    Next

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

    WMFastForward()
    ConsoleWrite(" : FF")
    Sleep(3000)
    WMReverse()
    ConsoleWrite(" : RR")
    Sleep(3000)
    WMPause()
    ConsoleWrite(" : Pause")
    Sleep(3000)
    WMResume()
    ConsoleWrite(" : Resume")
    Sleep(3000)
    WMStop()
    ConsoleWrite(" : Stop")
    Sleep(3000)
    WMPlay($sFilename)
    ConsoleWrite(" : Play")
    Sleep(3000)
    WMSetPosition(100)
    ConsoleWrite(" : Set Pos")

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

    MsgBox(0, "Song Data", "Duration - " & WMGetDuration($sObj) & @LF & _
    "Artist - " & WmGetArtist($sObj) & @LF & _
    "Album - " & WmGetAlbum($sObj) & @LF & _
    "Title - " & WmGetTitle($sObj) & @LF & _
    "Bitrate - " & WmGetBitrate($sObj) & @LF & _
    "MediaType - " & WmGetMediaType($sObj) & @LF & _
    "FileSize - " & WmGetFileSize($sObj) & @LF & _
    "FileType - " & WmGetFileType($sObj) & @LF & _
    "Category - " & WMGetCategory($sObj) & @LF & _
    "Genre - " & WMGetGenre($sObj) & @LF & _
    "Year - " & WMGetYear($sObj) & @LF & _
    "State - " & WMGetState())
    $sObj = 0
    WMClosePlayer()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
  • Probleme mit Fileinstall()

    • Xenobiologist
    • 6. Februar 2012 um 12:15

    Hi,

    der erste Pfad zur deiner Ini muss OHNE Varaiable angegeben werden. (siehe Hilfe)

    Mega

  • DriveGetDrive findet keine Netzlaufwerke

    • Xenobiologist
    • 6. Februar 2012 um 11:24

    Sind die denn wirklich noch verfügbar? Ggf. hat sich die IP geändert. Drück mal F5 :)
    oder versuch ein If FileExsits auf die Laufwerke.

  • DriveGetDrive findet keine Netzlaufwerke

    • Xenobiologist
    • 6. Februar 2012 um 10:41
    Spoiler anzeigen
    [autoit]

    Local $aArray = DriveGetDrive("ALL")
    If @error Then
    ; An error occurred when retrieving the drives.
    MsgBox(4096, "DriveGetDrive", "It appears an error occurred.")
    Else
    For $i = 1 To $aArray[0]
    ; Show all the drives found and convert the drive letter to uppercase.
    MsgBox(4096, "DriveGetDrive", "Drive " & $i & "/" & $aArray[0] & ":" & @CRLF & StringUpper($aArray[$i]))
    Next
    EndIf

    [/autoit]


    Geht bei mir einwandfrei.

  • Windows Media Player Objekt

    • Xenobiologist
    • 6. Februar 2012 um 10:32

    Ich denke mal, du musst erstmal das Objekt erzeugen und dir zurückgeben lassen.
    Dann kannst du damit arbeiten.
    Immer prüfen mit isObj ....

  • SciTE: Scriptneustart-Funktion

    • Xenobiologist
    • 5. Februar 2012 um 15:38

    Hi,

    ich habe mal eine Lösung ausprobiert.
    Folgendes muss getan werden, dann eine Restart-Funktion in Scite zur Verfügung steht.

    In der AutoIt3Warpper.au3 (unter Programme \AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3 ) zu finden.
    in Zeile 1049 dies

    [autoit]

    Run(@ScriptDir & '\Restart.exe ' & '"' & $AutoIT3_PGM & '"', @WorkingDir)

    [/autoit]

    ergänzen.

    Spoiler anzeigen
    [autoit]

    ; Run your script
    Run(@ScriptDir & '\Restart.exe ' & '"' & $AutoIT3_PGM & '"', @WorkingDir)
    $Pid = Run('"' & $AutoIT3_PGM & '" /ErrorStdOut "' & $ScriptFile_In & '" ' & $s_CMDLine, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    EndIf

    [/autoit]

    Dann die AutoItWrapper.au3 neu compilieren. Dies geht nicht, weil die exe ja benutzt wird zum Kompilieren.
    Also vorher in Zeile 4 den Namen ändern

    [autoit]

    #AutoIt3Wrapper_Outfile=_AutoIt3Wrapper.exe

    [/autoit]

    zum Beispiel einen Unterstrich davorsetzen. Dann kompilieren und anschließend die _AutoIt3Wrapper.exe umbenennen, sodass die AutoIt3Wrapper.exe ersetzt wird.

    Im selben Verzeichnis die Restart.exe legen. (hier die au3 die auch vorher noch kompiliert werden muss)

    Spoiler anzeigen
    [autoit]

    ; Restart

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

    Global $WM_COPYDATA = 74

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

    Opt('MustDeclareVars', 1)
    Opt('WinSearchChildren', 1)
    Opt('TrayIconHide', 1)

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

    AdlibRegister('_SelfExit', 1500)
    GUIRegisterMsg($WM_COPYDATA, 'MY_WM_COPYDATA')

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

    ; Variables
    Global $autoit3Exe = 'Autoit3.exe'
    Global $autoit3Wrapper = 'Autoit3wrapper.exe' ; 2x
    Global $sciteExe = 'SciTE.exe'
    Global $sciteWindowClass = '[CLASS:SciTEWindow]'
    ; SciTE variable
    Global $SciTECmd = 0

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

    HotKeySet('^!{F5}', '_restart')

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

    While 1
    Sleep(500)
    WEnd

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

    Func _restart()
    AdlibUnRegister('_selfExit')
    While ProcessExists($autoit3Exe) Or ProcessExists($autoit3Wrapper)
    ProcessClose($autoit3Exe)
    ProcessClose($autoit3Wrapper)
    Sleep(500) ; some time before the refresh starts
    _RefreshSystemTray()
    WEnd
    _runScriptInSciTE()
    EndFunc ;==>_restart

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

    ; Activating SciTE and sending the command for "GO" F5
    Func _runScriptInSciTE()
    If Not WinExists($sciteWindowClass, '') Or Not ProcessExists($sciteExe) Then
    MsgBox(16, 'Restart', 'No restart, because there is SciTE running')
    Exit (0)
    EndIf
    SendSciTE_Command('menucommand:420') ; Clear Output
    SendSciTE_Command('output:+> ' & '===============================================================================' & '\n')
    SendSciTE_Command('output:+> Restarting ... --> ' & _scriptName() & '\n')
    SendSciTE_Command('output:+> ' & '===============================================================================' & '\n')
    Sleep(250)
    WinActivate($sciteWindowClass, '')
    SendSciTE_Command('menucommand:' & _checkStableOrBeta()) ; GO
    Exit (0)
    EndFunc ;==>_runScriptInSciTE

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

    ; If no AutoIt3.exe or AutoIt3Wrapper.exe exists, then exit
    Func _SelfExit()
    If ProcessExists($autoit3Exe) = 0 And ProcessExists($autoit3Wrapper) = 0 Then Exit (0)
    EndFunc ;==>_SelfExit

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

    Func _checkStableOrBeta()
    Local $command = 0
    If $cmdLine[0] > 0 Then
    If StringInStr($cmdLine[1], 'beta') = 0 Then
    $command = '303' ; stable
    Else
    $command = '1100' ; beta
    EndIf
    Return $command
    EndIf
    MsgBox(16, 'Stable or Beta', 'Could not find Stable or Beta command')
    Exit(0)
    EndFunc ;==>_checkStableOrBeta

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

    ;===============================================================================
    ; Description: Sending commands to SciTE interface
    ;===============================================================================
    Func SendSciTE_Command($sCmd, $Wait_For_Return_Info = 0)
    Local $WM_GETTEXT = 0x000D
    Local $WM_GETTEXTLENGTH = 0x000E224
    Local Const $SCI_GETLINE = 2153
    Local $Scite_hwnd = WinGetHandle('DirectorExtension') ; Get SciTE Director Handle
    Local $My_Hwnd = GUICreate('AutoIt3-SciTE interface') ; Create GUI to receive SciTE info
    Local $My_Dec_Hwnd = Dec(StringTrimLeft($My_Hwnd, 2)) ; Convert my Gui Handle to decimal
    $sCmd = ':' & $My_Dec_Hwnd & ':' & $sCmd ; Add dec my gui handle to commandline to tell SciTE where to send the return info
    Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
    DllStructSetData($CmdStruct, 1, $sCmd)
    Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr')
    DllStructSetData($COPYDATA, 1, 1)
    DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1)
    DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct))
    DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $Scite_hwnd, _
    'Int', $WM_COPYDATA, 'HWnd', $My_Hwnd, _
    'Ptr', DllStructGetPtr($COPYDATA))
    GUIDelete($My_Hwnd)
    EndFunc ;==>SendSciTE_Command
    ;===============================================================================
    ; Description: Sending commands to SciTE interface
    ;===============================================================================
    Func MY_WM_COPYDATA($hWnd, $msg, $wParam, $lParam)
    Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr', $lParam)
    Local $SciTECmdLen = DllStructGetData($COPYDATA, 2)
    Local $CmdStruct = DllStructCreate('Char[255]', DllStructGetData($COPYDATA, 3))
    $SciTECmd = StringLeft(DllStructGetData($CmdStruct, 1), $SciTECmdLen)
    EndFunc ;==>MY_WM_COPYDATA

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

    Func _scriptName()
    Local $opt = Opt('WinTitleMatchMode', 4)
    SendSciTE_Command('askfilename:')
    $SciTECmd = StringReplace($SciTECmd, '\\', '\')
    Local $filename = StringTrimLeft($SciTECmd, StringInStr($SciTECmd, ':', Default, 3))
    Local $scriptDirPath = StringLeft($filename, StringInStr($filename, '\', Default, -1))
    Opt('WinTitleMatchMode', $opt)
    Return StringMid($filename, StringInStr($filename, '\', 2, -1) + 1, 100)
    EndFunc ;==>_scriptName

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

    ; ===================================================================
    ; Removes any dead icons from the notification area.
    ; Parameters:
    ; $nDelay - IN/OPTIONAL - The delay to wait for the notification area to expand with Windows XP's
    ; 'Hide Inactive Icons' feature (In milliseconds).
    ; Returns:
    ; Sets @error on failure:
    ; 1 - Tray couldn't be found.
    ; 2 - DllCall error.
    ; ===================================================================
    Func _RefreshSystemTray($nDelay = 1000)
    ; Save Opt settings
    Local $oldMatchMode = Opt('WinTitleMatchMode', 4)
    Local $oldChildMode = Opt('WinSearchChildren', 1)
    Local $error = 0
    Do; Pseudo loop
    Local $hWnd = WinGetHandle('classname=TrayNotifyWnd')
    If @error Then
    $error = 1
    ExitLoop
    EndIf

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

    Local $hControl = ControlGetHandle($hWnd, '', 'Button1')

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

    ; We're on XP and the Hide Inactive Icons button is there, so expand it
    If $hControl <> '' And ControlCommand($hWnd, '', $hControl, 'IsVisible', '') Then
    ControlClick($hWnd, '', $hControl)
    Sleep($nDelay)
    EndIf

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

    Local $posStart = MouseGetPos()
    Local $posWin = WinGetPos($hWnd)

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

    Local $y = $posWin[1]
    While $y < $posWin[3] + $posWin[1]
    Local $x = $posWin[0]
    While $x < $posWin[2] + $posWin[0]
    DllCall('user32.dll', 'int', 'SetCursorPos', 'int', $x, 'int', $y)
    If @error Then
    $error = 2
    ExitLoop 3; Jump out of While/While/Do
    EndIf
    $x += 8
    WEnd
    $y += 8
    WEnd
    DllCall('user32.dll', 'int', 'SetCursorPos', 'int', $posStart[0], 'int', $posStart[1])
    ; We're on XP so we need to hide the inactive icons again.
    If $hControl <> '' And ControlCommand($hWnd, '', $hControl, 'IsVisible', '') Then
    ControlClick($hWnd, '', $hControl)
    EndIf
    Until 1

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

    ; Restore Opt settings
    Opt('WinTitleMatchMode', $oldMatchMode)
    Opt('WinSearchChildren', $oldChildMode)
    SetError($error)
    EndFunc ;==>_RefreshSystemTray

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

    Anschließend kann in SciTE durch STRG+ALT+F5 das laufende Skript beendet und neu gestartet werden.

    Mega

    P.S: Ich weiß, viel Aufwand, aber manchmal braucht man sowas ja zum Testen :thumbup:

  • Lotus Notes automatisch starten mit AutoIT

    • Xenobiologist
    • 3. Februar 2012 um 14:10

    Hier ein altes Skript, welches noch gehen sollte.

    Spoiler anzeigen
    [autoit]

    Opt('SendKeyDelay', 1)
    Opt('WinTitleMatchMode', 2)
    #include <string.au3>

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

    Global Const $waitTitle = 'Lotus Notes'
    Global Const $waitTitle2 = '- XXX eG'
    Global Const $waitTitle3 = 'Arbeitsbereich'
    Global Const $process = 'nlnotes.exe'
    Global Const $defaultPath = 'C:\Programme\Notes\nlnotes.exe'
    Global Const $password = 'XXX'

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

    _run()
    Exit (0)

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

    Func _run()
    ;~ Local $password = _StringEncrypt(0, IniRead($pathPWD, 'Notes', 'PWD', 'Not Found'), @UserName & @ComputerName & RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "InstallDate"), 2)
    ShellExecute($defaultPath, '', '', 'open', @SW_SHOW)
    If WinWait($waitTitle, '', 40) = 0 Then Exit (0)
    WinSetState($waitTitle2, '', @SW_MAXIMIZE)
    ControlFocus($waitTitle, '', '')
    ControlSend($waitTitle, '', '', $password & '{Enter}')
    If WinWait($waitTitle3, '', 20) = 0 Then Exit (0)
    ControlSend($waitTitle3, '', '', '!l1')
    EndFunc ;==>_run

    [/autoit]

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™