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

Beiträge von name22

  • Script geht nicht weiter nach öffnen zweiter Form

    • name22
    • 18. Februar 2011 um 21:25

    So z.B.:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    Opt("GUIOnEventMode", 1)

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

    $hWnd_1 = GUICreate("Test 1", 200, 100, 50, 50)
    $cButton_1 = GUICtrlCreateButton("Button 1", 5, 5, 190, 90)
    GUISetState()

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

    $hWnd_2 = GUICreate("Test 2", 200, 100, 350, 50)
    $cButton_2 = GUICtrlCreateButton("Button 2", 5, 5, 190, 90)
    GUISetState()

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    GUICtrlSetOnEvent($cButton_1, "_Button1")
    GUICtrlSetOnEvent($cButton_2, "_Button2")

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

    While Sleep(1000)
    WEnd

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

    Func _Exit()
    Exit
    EndFunc

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

    Func _Button1()
    MsgBox(64, "GUI 1", "Button 1")
    EndFunc

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

    Func _Button2()
    MsgBox(64, "GUI 2", "Button 2")
    EndFunc

    [/autoit]
  • Script geht nicht weiter nach öffnen zweiter Form

    • name22
    • 18. Februar 2011 um 21:09

    Du kannst es im OnEventMode schreiben. Aber dein Script ist Blödsinn... 2 Endlosschleifen nacheinander bringen nämlich nicht viel...

  • Grafiken (GDIPlus) verschwinden beim Minimieren

    • name22
    • 17. Februar 2011 um 19:46

    Am besten nimmst du $GUI_EVENT_RESTORE ;).

  • UEZ hat Geburtstag

    • name22
    • 17. Februar 2011 um 17:59

    Happy Birthday UEZ! :thumbup:

  • 3/4 acht

    • name22
    • 16. Februar 2011 um 18:35

    Innerhalb meiner Familie wird das auch so ausgedrückt, aber in der Schule sagen wir oft z.B. "dreizehn Uhr fünfundvierzig". Das hängt wohl mit der Tatsache zusammen, dass wir alle ein wenig faul sind und die Uhrzeit fast immer vom Handy ablesen... Sonst wird eigentlich immer nur die Zeitspanne bis zum Ende der Schulstunde in Minuten angegeben :D .

  • mal wieder kleines StringRegEx problem

    • name22
    • 15. Februar 2011 um 22:18

    So?

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>

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

    $sHTML = ClipGet()
    $sPattern = '<div class=".+?">\s+?<span class=".+?">(.+?)</span>\s+?<span class=".+?">(.+?)</span>\s+?<span class=".+?">(.+?)</span>\s+?</div>'

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

    $aResult = StringRegExp($sHTML, $sPattern, 3)
    _ArrayDisplay($aResult)

    [/autoit]
  • Das letzte CRFL in einer Textdatei löschen.

    • name22
    • 15. Februar 2011 um 18:17

    Hier was mit StringRegExpReplace ;).

    [autoit]

    $sTest = FileRead("Test.txt")

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

    $sResult = StringRegExpReplace($sTest, '(?:\r\n)+?\z', "")

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

    FileWrite("TestNew.txt", $sResult)

    [/autoit]
  • Prozent Uhr - Mal eine ganz andere Uhr

    • name22
    • 13. Februar 2011 um 16:24
    Zitat

    name22 vielen dank für den Tipp. Wenn ich darf, würde ich das gerne so übernehmen.


    Klar kannst du das ;).

  • GDI+ Graphic leeren

    • name22
    • 12. Februar 2011 um 23:27

    Dann begrenze den Bereich in dem das Hintergrundbild neu gezeichnet wird. Das geht so:

    Spoiler anzeigen
    [autoit]

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

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

    $width = 1200
    $height = 800

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

    $hGUI = GUICreate("Form", $width, $height)
    GUISetState()

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

    _GDIPlus_Startup()

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

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
    $GDI_Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)

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

    $hBG = _GDIPlus_ImageLoadFromFile(@ScriptDir&"\bg.jpg")
    $hPen = _GDIPlus_PenCreate(0xFFFF0000)

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

    _GDIPlus_GraphicsDrawImageRect($GDI_Buffer, $hBG, 0, 0, $width, $height)

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

    AdlibRegister("_Draw", 500)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_ImageDispose($hBG)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($GDI_Buffer)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

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

    Func _Draw()
    $iX = Random(0, $width - 100, 1)
    $iY = Random(0, $height - 100, 1)
    $iWidth_Rect = Random(0, 100, 1)
    $iHeight_Rect = Random(0, 100, 1)

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

    _GDIPlus_GraphicsSetClipRect($GDI_Buffer, $iX, $iY, $iWidth_Rect + 1, $iHeight_Rect + 1)
    _GDIPlus_GraphicsDrawRect($GDI_Buffer, $iX, $iY, $iWidth_Rect, $iHeight_Rect, $hPen)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap, 0, 0, $width, $height)
    _GDIPlus_GraphicsDrawImageRect($GDI_Buffer, $hBG, 0, 0, $width, $height)
    EndFunc

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

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_GraphicsSetClipRect
    ; Description ...: Updates the clipping region of a Graphics object to a region that is the combination of itself and a rectangle
    ; Syntax.........: _GDIPlus_GraphicsSetClipRect($hGraphics, $nX, $nY, $nWidth, $nHeight[, $iCombineMode = 0])
    ; Parameters ....: $hGraphics - Pointer to a Graphics object
    ; $nX - X coordinate of the upper-left corner of the rectangle
    ; $nY - Y coordinate of the upper-left corner of the rectangle
    ; $nWidth - Width of the rectangle
    ; $nHeight - Height of the rectangle
    ; $iCombineMode - Regions combination mode:
    ; |0 - The existing region is replaced by the new region
    ; |1 - The existing region is replaced by the intersection of itself and the new region
    ; |2 - The existing region is replaced by the union of itself and the new region
    ; |3 - The existing region is replaced by the result of performing an XOR on the two regions
    ; |4 - The existing region is replaced by the portion of itself that is outside of the new region
    ; |5 - The existing region is replaced by the portion of the new region that is outside of the existing region
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: None
    ; Related .......: None
    ; Link ..........; @@MsdnLink@@ GdipSetClipRect
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_GraphicsSetClipRect($hGraphics, $nX, $nY, $nWidth, $nHeight, $iCombineMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetClipRect", "hwnd", $hGraphics, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int", $iCombineMode)

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

    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_GraphicsSetClipRect

    [/autoit]
  • GDI+ Graphic leeren

    • name22
    • 12. Februar 2011 um 22:49

    Mach es doch so:

    Spoiler anzeigen
    [autoit]

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

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

    $bgcolor = 0x00000000
    $width = 625
    $height = 443

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

    $hGUI = GUICreate("Form", $width, $height)
    GUISetState()

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

    _GDIPlus_Startup()

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

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
    $GDI_Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap)

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

    $hBG = _GDIPlus_ImageLoadFromFile(@ScriptDir&"\bg.jpg")
    $hPen = _GDIPlus_PenCreate(0xFFFF0000)

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

    AdlibRegister("_Draw", 100)

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_ImageDispose($hBG)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($GDI_Buffer)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

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

    Func _Draw()
    _GDIPlus_GraphicsDrawImage($GDI_Buffer, $hBG, 0, 0)
    _GDIPlus_GraphicsDrawRect($GDI_Buffer, Random(0, $width - 100), Random(0, $height - 100), Random(0, 100), Random(0, 100),$hPen)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap, 0, 0, $width, $height)
    EndFunc

    [/autoit]
  • StringRegExp - kurze Hilfe bitte

    • name22
    • 12. Februar 2011 um 20:33

    So?

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>

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

    $sText = ClipGet()
    $sPattern = '\s(\d+?\.?\d*)\b'

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

    $aResult = StringRegExp($sText, $sPattern, 3)
    _ArrayDisplay($aResult)

    [/autoit]
  • Verbesserungsvorschläge? zu oft StringRegExpReplace

    • name22
    • 12. Februar 2011 um 18:31

    Ich würde es so machen...

    [autoit]

    $sString = "http\u00253A\u00252F\u00252Fvideo.ak.fbcdn.net\u00252Fcfs-ak-ash1\u00252F12345\u00252F123\u00252F12345678901234567_12345.mp4\u00253Foh\u00253D123456789012345678901234567890123\u002526oe\u00253D12345678\u002526__gda__\u00253D1234567890_12345678901234567890123456789012"

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

    $aHexUnicode = StringRegExp($sString, "\\u([0-9ABCDEF]{6})", 3)
    For $i = 0 To UBound($aHexUnicode) - 1
    $sString = StringReplace($sString, "\u" & $aHexUnicode[$i], ChrW("0x" & StringLeft($aHexUnicode[$i], 2) & StringRight($aHexUnicode[$i], 2)))
    Next
    MsgBox(64, "New String", $sString)

    [/autoit]
  • Maus-O-Meter wie viel Meter hat die Maus zurückgelegt? | Jetzt mit Speicherfunktion

    • name22
    • 12. Februar 2011 um 18:06

    So wird das bei mir auch berechnet, nur muss man seine Bildschirmdiagonale in Zoll angeben. So viel Arbeit ist das nicht, und ich finde man sollte von so einem Programm schon korrekte Werte erwarten können.

  • PID herausfinden

    • name22
    • 12. Februar 2011 um 17:13

    Das ist wie Twodollarbillie's Script nur komplizierter und länger...

  • Prozent Uhr - Mal eine ganz andere Uhr

    • name22
    • 12. Februar 2011 um 16:50

    Nicht schlecht :thumbup: . Aber wenn du es so machst, flackert es nicht mehr ;).

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_icon=Prozent.ico
    #AutoIt3Wrapper_outfile=ProzentUhr.exe
    #AutoIt3Wrapper_UseX64=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

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

    #include <Date.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $titel = "Prozent Uhr 0.1 - by Douky"
    #Region ### START Koda GUI section ### Form=
    $Form1_1 = GUICreate($titel, 307, 296, 228, 196)
    $Group_zeit = GUICtrlCreateGroup("Group_zeit", 8, 128, 289, 161)
    GUICtrlSetFont(-1, 8, 800, 0, "Comic Sans MS")
    $Progress_Sekunde = GUICtrlCreateProgress(12, 266, 278, 17)
    $Progress_Minute = GUICtrlCreateProgress(12, 218, 278, 17)
    $Progress_Stunde = GUICtrlCreateProgress(12, 170, 278, 17)
    $Label1 = GUICtrlCreateLabel("Sekunde", 14, 241, 272, 20)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel("Minute", 14, 194, 277, 20)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $Label3 = GUICtrlCreateLabel("Stunde", 13, 145, 272, 24)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group_datum = GUICtrlCreateGroup("Group_datum", 8, 0, 289, 121)
    GUICtrlSetFont(-1, 8, 800, 0, "Comic Sans MS")
    $Progress_Monat = GUICtrlCreateProgress(14, 91, 278, 17)
    $Label_Monat = GUICtrlCreateLabel("Monat", 15, 68, 272, 20)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $Progress_Jahr = GUICtrlCreateProgress(13, 45, 278, 17)
    $Label_Jahr = GUICtrlCreateLabel("Jahr", 14, 22, 280, 20)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    ;WinSetTrans($titel, "", 125)

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

    AdlibRegister("_uhrrefresh", 250)

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

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

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

    EndSwitch
    WEnd

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

    Func _uhrrefresh()
    If _DateIsLeapYear(@YEAR) Then
    $Jahr_in_Sekunden = 31622400
    Else
    $Jahr_in_Sekunden = 31536000
    EndIf
    _GUICtrlSetData($Group_zeit, "Es ist " & @HOUR & ":" & @MIN & ":" & @SEC & " Uhr")
    _GUICtrlSetData($Group_datum, "Heute ist der " & @MDAY & "." & @MON & "." & @YEAR)

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

    $Zahl = 100 / $Jahr_in_Sekunden * _DateDiff('s', @YEAR & "/01/01 00:00:00", _NowCalc())
    _GUICtrlSetData($Progress_Jahr, $Zahl)
    _GUICtrlSetData($Label_Jahr, "Jahr" & @TAB & "(" & StringFormat("%.5f", $Zahl) & '%' & ")")

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

    $Monatprozent = 100 / (_DateDaysInMonth(@YEAR, @MON) * 24 * 60 * 60) * _DateDiff('s', @YEAR & "/" & @MON & "/01 00:00:00", _NowCalc())
    _GUICtrlSetData($Progress_Monat, $Monatprozent)
    _GUICtrlSetData($Label_Monat, "Monat" & @TAB & "(" & StringFormat("%.5f", $Monatprozent) & '%' & ")")

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

    $Tagprozent = 100 / 86400 * (@HOUR * 60 * 60 + @MIN * 60 + @SEC)
    _GUICtrlSetData($Progress_Stunde, $Tagprozent)
    _GUICtrlSetData($Label3, "Tag" & @TAB & "(" & StringFormat("%.5f", $Tagprozent) & '%' & ")")

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

    ;Stunde
    $Stundenprozent = 100 / 3600 * (@MIN * 60 + @SEC)
    _GUICtrlSetData($Progress_Minute, $Stundenprozent)
    _GUICtrlSetData($Label2, "Stunde" & @TAB & "(" & StringFormat("%.5f", $Stundenprozent) & '%' & ")")
    ;Stunde Ende

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

    ;Minuten
    $Minutenprozent = 100 / 60 * @SEC
    _GUICtrlSetData($Progress_Sekunde, $Minutenprozent)
    _GUICtrlSetData($Label1, "Minute" & @TAB & "(" & StringFormat("%.5f", $Minutenprozent) & '%' & ")")
    ;Minuten Ende
    EndFunc ;==>_uhrrefresh

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

    Func _GUICtrlSetData($cID, $vData)
    If GUICtrlRead($cID) <> $vData Then GUICtrlSetData($cID, $vData)
    EndFunc

    [/autoit]
  • Maus-O-Meter wie viel Meter hat die Maus zurückgelegt? | Jetzt mit Speicherfunktion

    • name22
    • 12. Februar 2011 um 16:39

    Auf meinem 22" FullHD sind laut deinem Script 14 cm nur 12 cm... Ich hab es mit einem Geodreieck abgemessen und ich halte es für sehr unwahrscheinlich, dass mein Geodreieck falsch liegt.

  • 3000 Pixel Lauf (100 Meter Lauf Clone =D) Wie schnell bist du?

    • name22
    • 12. Februar 2011 um 15:43

    9 Sekunden mit dem Touchpad auf meinem Laptop FTW! :D .

  • Maus-O-Meter wie viel Meter hat die Maus zurückgelegt? | Jetzt mit Speicherfunktion

    • name22
    • 12. Februar 2011 um 15:30

    Wenn ich einen Bildschirm habe auf dem 1 Pixel 1cm groß ist, stimmt dann die Umrechnungszahl noch?

  • Maus-O-Meter wie viel Meter hat die Maus zurückgelegt? | Jetzt mit Speicherfunktion

    • name22
    • 12. Februar 2011 um 14:48

    Das mit der Berechnung könntest du auch so machen... Das mit der Umrechnung in Meter kann doch so nicht stimmen, oder hat jeder Bildschirm die seleb Auflösung und Größe?

  • Schnitzel hat Geburtstag!

    • name22
    • 6. Februar 2011 um 22:32

    Happy Birthday Schnitzel! :thumbup:
    [Blockierte Grafik: http://img145.imageshack.us/img145/8468/schnitzel.png]
    Behold my incredible Photoshop Skillz :whistling: ...

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™