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. $var

Beiträge von $var

  • Klich auf Icons abfragen

    • $var
    • 24. Juli 2012 um 18:35
    [autoit]

    ; Gui, Icons, etc...

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

    Global $i_Msg
    While True
    $i_Msg = GUIGetMsg ()
    Switch $i_Msg
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch

    For $i = 0 To UBound ($Icons) - 1
    If $i_Msg = $Icons[$i] Then ExitLoop MsgBox (0, '', 'Sie haben auf Icon Nr.' & $i + 1 & ' geklickt')
    Next
    WEnd

    [/autoit]

    So in der Art würde ich es machen...

  • GDI+ auf unsichtbarer GUI

    • $var
    • 24. Juli 2012 um 11:30
    Spoiler anzeigen
    [autoit]

    #cs
    GDI+ Example - Draw on Transparent & Click-Through GUI
    by SEuBo, 24.12.2010

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

    http://www.elitepvpers.de/forum/autoit/9…hirm-malen.html

    /edit for a simple rectangle
    #ce

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

    #include <Misc.au3>
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>

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

    ;Variablen deklarieren
    Local $hGUI, $hGraphics, $hPen

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

    ;GDI+ initialisieren, ESC als HotKey festlegen
    _GDIPlus_Startup()
    HotKeySet("{ESC}", "_Exit")

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

    ;Transparente GUI erstellen
    $hDummy = GUICreate("") ; Dummy GUI, damit richtiges nicht in Taskleiste auftaucht.
    $hGUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TRANSPARENT), $hDummy)
    GUISetBkColor(0xABCDEF, $hGUI)
    _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF, 255)

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

    ;Graphic-Objekt, Pinsel und Backbuffer erstellen und GUI anzeigen
    $hPen = _GDIPlus_PenCreate(0xFFFF0000, 4) ; Roten Pinsel mit Breite von 4 px.
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    GUISetState()

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

    _GDIPlus_GraphicsDrawRect($hGraphics, 100, 100, 200, 200, $hPen)

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

    While Sleep(10)
    WEnd

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

    Func _Exit()
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_PenDispose($hPen)
    GUIDelete($hGUI)
    GUIDelete($hDummy)
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Das Script ist nicht von mir. Funktioniert aber trotzdem... 8o

  • Klick auf leere Form

    • $var
    • 24. Juli 2012 um 11:28
    [autoit]

    #include <GUIConstantsEx.au3>

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

    GUICreate ('')
    GUISetState ()

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

    While True
    Switch GUIGetMsg ()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $GUI_EVENT_PRIMARYDOWN
    MsgBox (0, '', 'GUIGetMsg() = $GUI_EVENT_PRIMARYDOWN')
    EndSwitch
    WEnd

    [/autoit]
  • GuiCreate ohne Titelleiste und trotzdem verschiebbar

    • $var
    • 22. Juli 2012 um 19:47

    Das geht mit dem Style $GUI_WS_EX_PARENTDRAG.

    Zitat

    Allow the label or pic control to be used as the title bar to drag the whole the parent window.

  • Nach USB-Stick suchen

    • $var
    • 21. Juli 2012 um 13:39

    Nooblike-Lösung:

    [autoit]

    Do
    Sleep (5000)
    Until FileExists ('E:\datei.txt')
    MsgBox (16, 'Inhalt von E:\datei.txt', FileRead ('E:\datei.txt'))

    [/autoit]
  • Checkbox Textfarbe ändern

    • $var
    • 20. Juli 2012 um 15:04

    Verwende für die Checkboxen und Labels ein zweidimensionales Array. Dann hast du immer Zugriff.
    Hier ein Beispiel:

    Spoiler anzeigen
    [autoit]

    Global $h_Gui, $i_Msg, $ah_Checkbox[10][2]

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

    $h_Gui = GUICreate ('')
    For $i = 0 To UBound ($ah_Checkbox) - 1
    $ah_Checkbox[$i][0] = GUICtrlCreateCheckbox ('', 10, 10 + ($i * 20), 13, 13)
    $ah_Checkbox[$i][1] = GUICtrlCreateLabel ('Unchecked ' & $i + 1, 26, 10 + ($i * 20), 100, 13)
    Next

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

    GUISetState (@SW_SHOW, $h_Gui)

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

    While True
    $i_Msg = GUIGetMsg ()
    Switch $i_Msg
    Case -3
    Exit
    EndSwitch

    For $i = 0 To UBound ($ah_Checkbox) - 1
    If $i_Msg = $ah_Checkbox[$i][0] Then
    If BitAND (GUICtrlRead ($ah_Checkbox[$i][0]), 1) Then
    GUICtrlSetData ($ah_Checkbox[$i][1], 'Checked ' & $i + 1)
    GUICtrlSetColor ($ah_Checkbox[$i][1], 0x0000FF)
    Else
    GUICtrlSetData ($ah_Checkbox[$i][1], 'Unchecked ' & $i + 1)
    GUICtrlSetColor ($ah_Checkbox[$i][1], 0x000000)
    EndIf
    EndIf
    Next
    WEnd

    [/autoit]
  • Checkbox Textfarbe ändern

    • $var
    • 20. Juli 2012 um 14:19

    Soweit ich weiß, kann man die Textfarbe der Checkboxen und Radios nicht ändern.
    Ich selbst verwende dafür extra Labels.

    Spoiler anzeigen
    [autoit]

    Global $h_Gui, $h_Checkbox, $h_Label

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

    $h_Gui = GUICreate ('')
    $h_Checkbox = GUICtrlCreateCheckbox ('', 10, 10, 13, 13)
    $h_Label = GUICtrlCreateLabel ('Beschreibung', 26, 10, 100, 13)

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

    GUISetState (@SW_SHOW, $h_Gui)

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

    While True
    Switch GUIGetMsg ()
    Case -3
    Exit
    Case $h_Checkbox
    If BitAND (GUICtrlRead ($h_Checkbox), 1) Then
    GUICtrlSetColor ($h_Label, 0x0000FF)
    Else
    GUICtrlSetColor ($h_Label, 0x000000)
    EndIf
    EndSwitch
    WEnd

    [/autoit]
  • Kann _FileWriteFromArray ein 2D array schreiben???

    • $var
    • 19. Juli 2012 um 16:30

    Ein kurzer Blick in die File.au3 genügt. Man kann an die Funktion nur eindimensionale Arrays übergeben.
    Mit etwas Logik kann man sich auch eine eigene Funktion für 2D-Arrays schreiben. Versuch es doch mal. ;)

  • zeilen aus verschiedenen logdateien löschen

    • $var
    • 18. Juli 2012 um 20:32

    Gibt es bei den nicht-brauchbaren Zeilen irgendwelche bestimmten Muster, durch die man sie erkennen kann?
    Falls ja, dann sollte das Ganze kein großes Problem darstellen.

    Zeig mal ein Beispiel.

  • Screenshot Problem

    • $var
    • 18. Juli 2012 um 16:06

    Hier mal ein Beispiel, wie du die Funktion nutzen kannst...

    Spoiler anzeigen
    [autoit]

    #NoTrayIcon
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>

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

    _GDIPlus_Startup ()
    Opt ("GUIOnEventMode", 1)

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

    Global Const $i_WIDTH = 400, $i_HEIGHT = 200

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

    Global $h_Gui = GUICreate ("", $i_WIDTH, $i_HEIGHT)
    Global $h_Graphics = _GDIPlus_GraphicsCreateFromHWND ($h_Gui)

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

    GUISetOnEvent (-3, "_Exit", $h_Gui)
    OnAutoItExitRegister ("_OnExit")
    GUISetState (@SW_SHOW, $h_Gui)

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

    _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, 'Dein String', 20, 50, 11.5, 0xFFFF0000)
    _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, '_GDIPlus_GraphicsDrawStringCustom', 20, 100, 9, 0xFF333333, 0, 1, 'Arial')

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

    While Sleep (10000)
    WEnd

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

    Func _Exit ()
    Exit
    EndFunc ;==> _Exit

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

    Func _OnExit ()
    _GDIPlus_GraphicsDispose ($h_Graphics)
    _GDIPlus_Shutdown ()
    EndFunc ;==> _OnExit

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

    ; #FUNCTION# ===================================================================
    ; Name ..........: _GDIPlus_GraphicsDrawStringCustom
    ; Description ...: Draw a customized string
    ; AutoIt Version : v3.3.6.1
    ; Syntax ........: _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, $s_String, $i_X, $i_Y, $n_Size, $b_Color[, $i_Align = 0[, $i_Weight = 0[, $s_Font = 'Tahoma']]])
    ; Parameter(s): .: $h_Graphics - Handle to a Graphics object
    ; $s_String - String to be drawn
    ; $i_X - X coordinate where the string will be drawn
    ; $i_Y - Y coordinate where the string will be drawn
    ; $n_Size - Font size to use for drawing
    ; $b_Color - Alpha, Red, Green and Blue components
    ; $i_Align - The alignment can be one of the following:
    ; |0 - The text is aligned to the left
    ; |1 - The text is centered
    ; |2 - The text is aligned to the right
    ; $i_Weight - The style of the typeface. Can be a combination of the following:
    ; |0 - Normal weight or thickness of the typeface
    ; |1 - Bold typeface
    ; |2 - Italic typeface
    ; |4 - Underline
    ; |8 - Strikethrough
    ; $s_Font - Name of the Font Family
    ; Return Value ..: Success - True
    ; Failure - False
    ; Author(s) .....: $var
    ; ==============================================================================
    Func _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, $s_String, $i_X, $i_Y, $n_Size, $b_Color, $i_Align = 0, $i_Weight = 0, $s_Font = 'Tahoma')
    Local $a_CreateSolidFill, $a_CreateStringFormat, $a_CreateFontFamilyFromName, $a_CreateFont, $t_Struct, $p_Layout, $a_Return
    $a_CreateSolidFill = DllCall ($ghGDIPDll, 'int', 'GdipCreateSolidFill', 'int', $b_Color, 'dword*', 0)
    $a_CreateStringFormat = DllCall ($ghGDIPDll, 'int', 'GdipCreateStringFormat', 'int', 0, 'word', 0, 'ptr*', 0)
    $a_CreateFontFamilyFromName = DllCall ($ghGDIPDll, 'int', 'GdipCreateFontFamilyFromName', 'wstr', $s_Font, 'ptr', 0, 'handle*', 0)
    $a_CreateFont = DllCall ($ghGDIPDll, 'int', 'GdipCreateFont', 'handle', $a_CreateFontFamilyFromName[3], 'float', $n_Size, 'int', $i_Weight, 'int', 3, 'ptr*', 0)
    $t_Struct = DllStructCreate ($tagGDIPRECTF)
    $p_Layout = DllStructGetPtr ($t_Struct)
    DllStructSetData ($t_Struct, 'X', $i_X)
    DllStructSetData ($t_Struct, 'Y', $i_Y)
    DllStructSetData ($t_Struct, 'Width', 0)
    DllStructSetData ($t_Struct, 'Height', 0)
    DllCall ($ghGDIPDll, 'int', 'GdipSetStringFormatAlign', 'handle', $a_CreateStringFormat[3], 'int', $i_Align)
    $a_Return = DllCall ($ghGDIPDll, 'int', 'GdipDrawString', 'handle', $h_Graphics, 'wstr', $s_String, 'int', -1, 'handle', $a_CreateFont[5], _
    'ptr', $p_Layout, 'handle', $a_CreateStringFormat[3], 'handle', $a_CreateSolidFill[2])
    Return $a_Return[0] = 0
    EndFunc ;==> _GDIPlus_GraphicsDrawStringCustom

    [/autoit]
  • Screenshot Problem

    • $var
    • 18. Juli 2012 um 12:32

    Probiere mal diese Funktion aus. Damit kann man so ziemlich alles relevante einstellen:

    _GDIPlus_GraphicsDrawStringCustom
    [autoit]

    ; #FUNCTION# ===================================================================
    ; Name ..........: _GDIPlus_GraphicsDrawStringCustom
    ; Description ...: Draw a customized string
    ; AutoIt Version : v3.3.6.1
    ; Syntax ........: _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, $s_String, $i_X, $i_Y, $n_Size, $b_Color[, $i_Align = 0[, $i_Weight = 0[, $s_Font = 'Tahoma']]])
    ; Parameter(s): .: $h_Graphics - Handle to a Graphics object
    ; $s_String - String to be drawn
    ; $i_X - X coordinate where the string will be drawn
    ; $i_Y - Y coordinate where the string will be drawn
    ; $n_Size - Font size to use for drawing
    ; $b_Color - Alpha, Red, Green and Blue components
    ; $i_Align - The alignment can be one of the following:
    ; |0 - The text is aligned to the left
    ; |1 - The text is centered
    ; |2 - The text is aligned to the right
    ; $i_Weight - The style of the typeface. Can be a combination of the following:
    ; |0 - Normal weight or thickness of the typeface
    ; |1 - Bold typeface
    ; |2 - Italic typeface
    ; |4 - Underline
    ; |8 - Strikethrough
    ; $s_Font - Name of the Font Family
    ; Return Value ..: Success - True
    ; Failure - False
    ; Author(s) .....: $var
    ; ==============================================================================
    Func _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, $s_String, $i_X, $i_Y, $n_Size, $b_Color, $i_Align = 0, $i_Weight = 0, $s_Font = 'Tahoma')
    Local $a_CreateSolidFill, $a_CreateStringFormat, $a_CreateFontFamilyFromName, $a_CreateFont, $t_Struct, $p_Layout, $a_Return
    $a_CreateSolidFill = DllCall ($ghGDIPDll, 'int', 'GdipCreateSolidFill', 'int', $b_Color, 'dword*', 0)
    $a_CreateStringFormat = DllCall ($ghGDIPDll, 'int', 'GdipCreateStringFormat', 'int', 0, 'word', 0, 'ptr*', 0)
    $a_CreateFontFamilyFromName = DllCall ($ghGDIPDll, 'int', 'GdipCreateFontFamilyFromName', 'wstr', $s_Font, 'ptr', 0, 'handle*', 0)
    $a_CreateFont = DllCall ($ghGDIPDll, 'int', 'GdipCreateFont', 'handle', $a_CreateFontFamilyFromName[3], 'float', $n_Size, 'int', $i_Weight, 'int', 3, 'ptr*', 0)
    $t_Struct = DllStructCreate ($tagGDIPRECTF)
    $p_Layout = DllStructGetPtr ($t_Struct)
    DllStructSetData ($t_Struct, 'X', $i_X)
    DllStructSetData ($t_Struct, 'Y', $i_Y)
    DllStructSetData ($t_Struct, 'Width', 0)
    DllStructSetData ($t_Struct, 'Height', 0)
    DllCall ($ghGDIPDll, 'int', 'GdipSetStringFormatAlign', 'handle', $a_CreateStringFormat[3], 'int', $i_Align)
    $a_Return = DllCall ($ghGDIPDll, 'int', 'GdipDrawString', 'handle', $h_Graphics, 'wstr', $s_String, 'int', -1, 'handle', $a_CreateFont[5], _
    'ptr', $p_Layout, 'handle', $a_CreateStringFormat[3], 'handle', $a_CreateSolidFill[2])
    Return $a_Return[0] = 0
    EndFunc ;==> _GDIPlus_GraphicsDrawStringCustom

    [/autoit]

    €: Tutorial

  • Screenshot Problem

    • $var
    • 18. Juli 2012 um 11:16
    [autoit]

    _GDIPlus_ImageSaveToFile($hImage, $sFileName)

    [/autoit]
  • Unstrukturieren Text parsen - wie ?

    • $var
    • 17. Juli 2012 um 20:01

    Ich habe den Code probiert, nutze aber auch die alte AutoIt-Version... Kann gut sein, dass es so nicht mehr funktioniert.
    Da stellt sich mir nur die Frage; wieso?
    Irgendwie verstehe ich denn Sinn und Zweck dahinter nicht.

  • Unstrukturieren Text parsen - wie ?

    • $var
    • 17. Juli 2012 um 16:55
    [autoit]

    #include <Array.au3>

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

    _ArrayDisplay (StringRegExp (ClipGet (), 'Subject:(.+)', 3))

    [/autoit]
  • TAB Prüfen

    • $var
    • 16. Juli 2012 um 15:30
    Spoiler anzeigen
    [autoit]

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

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

    $Form1 = GUICreate("Form1", 625, 443, 192, 124)
    $Tab1 = GUICtrlCreateTab(40, 56, 417, 337)
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
    $TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
    GUICtrlCreateTabItem("")
    $Button1 = GUICtrlCreateButton("Tab Create", 496, 80, 75, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)

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

    Global $TabSheet3

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Button1

    If Not IsInt ($TabSheet3) Then $TabSheet3 = GUICtrlCreateTabItem("Daten1")

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

    EndSwitch
    WEnd

    [/autoit]
  • PDF Datei nach Wort durchsuchen und dieses dann als Dateiname verwenden und die Datei umbenennen.

    • $var
    • 15. Juli 2012 um 17:46
    [autoit]

    MsgBox (0, '', '"C:\Program Files (x86)\Two Pilots\PDF2Text Pilot\textextract.exe" ' & $s_Path & $s_Ext & $a_List[$i] & " /to " & @TempDir & "\out.txt")

    [/autoit]
  • PDF Datei nach Wort durchsuchen und dieses dann als Dateiname verwenden und die Datei umbenennen.

    • $var
    • 15. Juli 2012 um 13:09

    In der Zeile mit RunWait fehlt am Ende eine schließende Klammer ).

  • Text aus String herausfiltern

    • $var
    • 13. Juli 2012 um 23:45

    Ah, dann müsste man es einfach so machen:

    [autoit]

    MsgBox (0, '', StringRegExpReplace ('34/2*6+a*400-var', '([a-z]{1,})', '\$$1'))

    [/autoit]
  • Text aus String herausfiltern

    • $var
    • 13. Juli 2012 um 23:33
    [autoit]

    Global $var = 'ersatz' ; Nur so random...
    MsgBox (0, '', StringRegExpReplace ('34/2*6+a*400-var', '[a-z]{1,}', $var))

    [/autoit]

    So etwa?

  • Sehr schneller Rechner - erkennen von mehreren Prozessoren

    • $var
    • 13. Juli 2012 um 19:01

    Prüfe vorher, ob die Variable ein Objekt enthält.

    [autoit]

    If Not IsObj ($oProc) Then ;...

    [/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™