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

  • in mehreren Zeilen Tabs einfügen im AutoIT-SciTE -Editor

    • Xenobiologist
    • 21. Dezember 2011 um 09:44

    Willst du deinen Code formatieren? Drück mal STRG+T

  • An und Auschalten der Keys

    • Xenobiologist
    • 21. Dezember 2011 um 08:38

    Macht es so nicht mehr Sinn?

    Spoiler anzeigen
    [autoit]

    HotKeySet("^o", "KeyToggle")
    HotKeySet("1", "K1")

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

    Global $KeyOnOff = False

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

    Func KeyToggle()
    $KeyOnOff = Not $KeyOnOff
    EndFunc ;==>KeyToggle

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

    Func K1()
    If $KeyOnOff Then
    Send("Hallo")
    Else
    HotKeySet("1")
    Send(@HotKeyPressed)
    HotKeySet("1", "K1")
    EndIf
    EndFunc ;==>K1

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

    While 1
    Sleep(100)
    WEnd

    [/autoit]
  • Select If

    • Xenobiologist
    • 16. Dezember 2011 um 10:51

    Ja, klassischer Fall von Case When.

  • Program aus dem Tray öffnen

    • Xenobiologist
    • 15. Dezember 2011 um 16:59

    Einfacher wäre es ggf. die Fenster mit WinSetTitle zu nummerieren und dann einfach anzusteuern.

  • Musikstream Titel auslesen

    • Xenobiologist
    • 10. Dezember 2011 um 14:20

    Es gibt eine UDF die mit dem Object arbeitet.
    Des Weiteren könntest du mal schauen was Autoit Window Info so ausspuckt.

  • Robocopy

    • Xenobiologist
    • 8. Dezember 2011 um 18:23

    Über WM_ sollte das doch einfach möglich sein.
    Warum hast du die Controls nicht ordentlich mit Namen versehen?
    Warum hat der Thread so viele hits? :)

  • Bild in Excel einfügen

    • Xenobiologist
    • 1. Dezember 2011 um 13:11
    Spoiler anzeigen
    [autoit]

    ;===============================================================================
    ;
    ; Description: Insert a picture from a separate file into the active sheet.
    ; Syntax: _ExcelPictureInsert($oExcel, $sFilePath, $iLeft, $iTop, $iWidth, $iHeight, $fLinkToFile = False, $fSaveWithDoc = False)
    ; Parameter(s): $oExcel - An Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew()
    ; $sFilePath - The full path of the picture to be inserted
    ; $fLinkToFile - "True" to link the picture to the file from which it was created.
    ; "False" to make the picture an independent copy of the file. The default value is False.
    ; $fSaveWithDoc - "True" to save the linked picture with the document. The default value is False.
    ; $iLeft - The position (in points) of the upper-left corner of the picture relative to the upper-left corner of the worksheet
    ; $iTop - The position (in points) of the upper-left corner of the picture relative to the top of the worksheet
    ; $iWidth - The width of the picture, in points
    ; $iHeight - The height of the picture, in points
    ; Requirement(s): None
    ; Return Value(s): On Success - Returns an object representing the inserted picture
    ; On Failure - Returns 0 and sets @error on errors:
    ; @error=1 - Specified object does not exist
    ; Author(s): SEO <locodarwin at yahoo dot com>
    ; Note(s): None
    ;
    ;===============================================================================
    Func _ExcelPictureInsert($oExcel, $sFilePath, $iLeft, $iTop, $iWidth, $iHeight, $fLinkToFile = False, $fSaveWithDoc = False)
    If NOT IsObj($oExcel) Then Return SetError(1, 0, 0)
    If NOT FileExists($sFilePath) Then Return SetError(2, 0, 0)
    If $iLeft < 1 Then $iLeft = 1
    If $iTop < 1 Then $iTop = 1
    If $iWidth < 1 Then $iWidth = 1
    If $iHeight < 1 Then $iHeight = 1
    $oExcel.ActiveSheet.Shapes.AddPicture($sFilePath, $fLinkToFile, $fSaveWithDoc, $iLeft, $iTop, $iWidth, $iHeight).Select
    Return $oExcel.Selection.ShapeRange
    EndFunc ;==>_ExcelPictureInsert

    [/autoit]
  • Controls in Tab erzeugen

    • Xenobiologist
    • 1. Dezember 2011 um 11:33

    Guck/Such mal nach WM_NOTIFY($hWnd, $iMsg, $iWparam, $iLparam) damit sollte es gehen.
    Ist allerdings etwas umständlich.

  • Überprüfen ob PC gesperrt ist

    • Xenobiologist
    • 30. November 2011 um 16:39
    Spoiler anzeigen
    [autoit]

    Global Const $DESKTOP_ENUMERATE = 0x40
    Global Const $SPI_GETSCREENSAVERRUNNING = 114
    Global Const $DESKTOP_SWITCHDESKTOP = 0x100

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

    HotKeySet("{ESC}", "_Terminate")
    AdlibRegister("IsDeskTopLocked", 500)

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

    While 1
    Sleep(10)
    WEnd

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

    Func IsDeskTopLocked()
    Local $p_lngHwnd, $p_lngRtn, $p_lngErr, $p_lngScreenSaver, $p_blnIsScreenSaver

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

    ;~ ' ------------------------------------------
    ;~ ' First check for screen saver one of 2 ways,
    ;~ ' based of OS
    ;~ ' ------------------------------------------
    If @OSTYPE = "WIN32_WINDOWS" Then
    ;~ ' ---------------------------------------
    ;~ ' Pre W2K -- Note, will only be TRUE if
    ;~ ' the "Password Protected" box is
    ;~ ' checked.
    ;~ ' ---------------------------------------
    $p_lngHwnd = DllCall("user32.dll", "int", "OpenDesktopA", "str", "screen-saver", "int", 0, "int", False, "int", $DESKTOP_ENUMERATE)
    If $p_lngHwnd[0] <> 0 Then
    $p_blnIsScreenSaver = True
    Else
    $p_blnIsScreenSaver = False
    EndIf
    Else
    ;~ ' ---------------------------------------
    ;~ ' W2K+ -- Will determine if screen saver
    ;~ ' is running whether or not the
    ;~ ' "Password Protected" box is checked
    ;~ ' ---------------------------------------
    $p_lngRtn = DllCall("user32.dll", "int", "SystemParametersInfoA", "int", $SPI_GETSCREENSAVERRUNNING, "int", 0, "int", $p_lngScreenSaver, "int", 0)
    If $p_lngRtn[0] = 0 Then
    ConsoleWrite("+>Error detecting screen saver" & @LF)
    Else
    $p_blnIsScreenSaver = $p_lngScreenSaver
    EndIf

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

    EndIf

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

    ;~ ' ------------------------------------------
    ;~ ' If screen saver is *not* running, then
    ;~ ' check for locked workstation
    ;~ ' ------------------------------------------
    If $p_blnIsScreenSaver Then
    If @OSTYPE = "WIN32_WINDOWS" Then
    ConsoleWrite("Screen saver is running..., Handle #" & $p_lngHwnd[0] & @LF)
    $p_lngHwnd = DllCall("user32.dll", "int", "CloseDesktop", "int", $p_lngHwnd[0])
    Else
    ConsoleWrite("Screen saver is running on W2K+" & @LF)
    EndIf

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

    Else
    $p_lngHwnd = DllCall("user32.dll", "int", "OpenDesktopA", "str", "Default", "int", 0, "int", False, "int", $DESKTOP_SWITCHDESKTOP)

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

    If $p_lngHwnd[0] = 0 Then
    ConsoleWrite("Error with OpenDesktop" & @LF)

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

    Else
    $p_lngRtn = DllCall("user32.dll", "int", "SwitchDesktop", "int", $p_lngHwnd[0])
    $p_lngErr = _GetLastErrorMessage()

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

    If $p_lngRtn[0] = 0 Then
    If $p_lngErr = 0 Then
    ConsoleWrite("! Desktop is locked" & @LF)
    Else
    ConsoleWrite("Error with SwitchDesktop" & @LF)
    EndIf
    Else
    ConsoleWrite("Not locked!" & @LF)
    EndIf

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

    $p_lngHwnd = DllCall("user32.dll", "int", "CloseDesktop", "int", $p_lngHwnd[0])

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

    EndIf
    EndIf
    EndFunc ;==>IsDeskTopLocked

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

    Func _Terminate()
    Exit
    EndFunc ;==>_Terminate

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

    ;===============================================
    ; _GetLastErrorMessage($DisplayMsgBox="")
    ; Format the last windows error as a string and return it
    ; if $DisplayMsgBox <> "" Then it will display a message box w/ the error
    ; Return Window's error as a string
    ;===============================================
    Func _GetLastErrorMessage($DisplayMsgBox = "")
    Local $ret, $s
    Local $p = DllStructCreate("char[4096]")
    Local Const $FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000

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

    If @error Then Return ""

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

    $ret = DllCall("Kernel32.dll", "int", "GetLastError")

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

    $ret = DllCall("kernel32.dll", "int", "FormatMessage", _
    "int", $FORMAT_MESSAGE_FROM_SYSTEM, _
    "ptr", 0, _
    "int", $ret[0], _
    "int", 0, _
    "ptr", DllStructGetPtr($p), _
    "int", 4096, _
    "ptr", 0)
    $s = DllStructGetData($p, 1)
    If $DisplayMsgBox <> "" Then MsgBox(0, "_GetLastErrorMessage", $DisplayMsgBox & @CRLF & $s)
    Return $s
    EndFunc ;==>_GetLastErrorMessage

    [/autoit]
    Spoiler anzeigen
    [autoit]

    While 1
    Sleep(1000)
    If _isWorksatationLocked() Then ConsoleWrite(@HOUR & ":" & @MIN & ":" & @SEC & " - " & "workstation locked" & @CRLF)
    WEnd

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

    Func _isWorksatationLocked()
    If StringInStr(WinGetText(""), "Program Manager") <> 0 And WinGetTitle("") = "" Then Return 1
    Return 0
    EndFunc ;==>_isWorksatationLocked

    [/autoit]
  • Combobox Item nicht auswählbar setzen

    • Xenobiologist
    • 29. November 2011 um 15:47

    Sowas?

    Spoiler anzeigen
    [autoit]

    #include <ComboConstants.au3>
    #include <GuiComboBox.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <WinAPI.au3>
    $hGui = GUICreate("Neuen Eintrag hinzufügen", Default, Default, -1, -1)
    $Combo = GUICtrlCreateCombo("", 1, 1, 150, 100, $CBS_DROPDOWNLIST)
    _GUICtrlComboBox_AddString($Combo, "------Kategorie1")
    _GUICtrlComboBox_AddString($Combo, "Eintrag 1")
    _GUICtrlComboBox_AddString($Combo, "Eintrag 2")
    _GUICtrlComboBox_AddString($Combo, "Eintrag 3")
    _GUICtrlComboBox_AddString($Combo, "Eintrag 4")
    _GUICtrlComboBox_AddString($Combo, "------Kategorie 2")
    _GUICtrlComboBox_AddString($Combo, "Eintrag 5")
    _GUICtrlComboBox_AddString($Combo, "Eintrag 6")
    _GUICtrlComboBox_AddString($Combo, "Eintrag 7")
    _GUICtrlComboBox_AddString($Combo, "Eintrag 8")
    GUISetState()

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

    GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")

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

    Do
    $msg = GUIGetMsg()

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

    Until $msg = $GUI_EVENT_CLOSE

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

    Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam)
    Local $controlID = _WinAPI_LoWord($wParam)
    If $controlID = $Combo Then
    If StringInStr(GUICtrlRead($Combo), 'Kategorie') <> 0 Then
    _GUICtrlComboBox_SetCurSel($Combo, _GUICtrlComboBox_GetCurSel($Combo) + 1)
    MsgBox(64, 'Info', 'Auswahl nicht erlaubt!', 1)
    EndIf
    ; hier jegliche Logik rein.
    EndIf
    EndFunc ;==>MY_WM_COMMAND

    [/autoit]
  • Der Musik zur Liebe...

    • Xenobiologist
    • 18. November 2011 um 18:48

    Hab mal reingehört. Ich bin nicht so der Rap-fan. Aber klingt als würde es einem bestimmten Klientel gefallen.

  • Alles Gute Xenobiologist

    • Xenobiologist
    • 12. November 2011 um 13:34

    DANKE an ALLE!
    Die Alienlady ist wirklich sexy ;)

  • xml schön aufbereiten

    • Xenobiologist
    • 9. November 2011 um 15:06

    Lad mal eine Datei hoch, sodass man den Fehler nachstellen kann.

  • xml schön aufbereiten

    • Xenobiologist
    • 9. November 2011 um 14:39
    [autoit]

    #include "_XMLDomWrapper.au3"
    _XMLFileOpen(@ScriptDir &'\XMLTestfile.xml')
    _XMLTransform($objDoc.xml);, "", @ScriptDir & "\XMLJUHU.xml")
    FileWrite('XMLjuhu.xml', $objDoc.xml)

    [/autoit]
  • xml schön aufbereiten

    • Xenobiologist
    • 9. November 2011 um 12:16

    Wie viele hast du denn? UltraEdit hat ein XMl Formatter.

  • ByRef auf Variablen/Arrays ohne Funktion?

    • Xenobiologist
    • 8. November 2011 um 09:17

    Ich glaube in Autoit kannst du nur ByRef für Funktionen nutzen und ansonsten musst du eine neue Variable anlegen und den Werte zuweisen.

  • ByRef auf Variablen/Arrays ohne Funktion?

    • Xenobiologist
    • 7. November 2011 um 16:50

    Meinst du eine globale Variable?

  • Trouble mit den Arrays

    • Xenobiologist
    • 7. November 2011 um 16:47

    Füge doch mal in Zeile 19 dies ein:

    ConsoleWrite('! PFAD: ' & $lineArr[1] & "\*.xml")

    Warum eigentlich \* ?

  • Write UTF-16 ohne BOM

    • Xenobiologist
    • 7. November 2011 um 16:44

    Ich kenne mich mit Codierungen nicht so aus, aber kannst du nicht einfach UF8 nutzen?

  • Dynamisch erstellte Buttons abfragen

    • Xenobiologist
    • 19. Oktober 2011 um 19:06

    Meinst du, in dem du die Buttons vorher erzeugst? Also bevor die Verarbeitung beginnt.

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™