• Hier is mein Kleines nutzloses Skript :rofl:

    das ich aus langeweile geschreiben habe


    Spoiler anzeigen
    [autoit]


    #include<GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    _GDIPlus_Startup()
    $hGUI = GUICreate("Form1", 625, 443, 192, 124)
    $Graphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    GUISetState(@SW_SHOW)

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

    $Rot = _GDIPlus_PenCreate(0xFFFF0000)
    $Gruen = _GDIPlus_PenCreate(0xFF00FF00)
    $Blau = _GDIPlus_PenCreate(0xFF0000FF)

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

    For $y = 1 To 442
    For $x = 0 To 624
    $Random = Random(1, 3,1)
    Switch $Random
    Case 1
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Rot)
    Case 2
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Gruen)
    Case 3
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Blau)
    EndSwitch
    Next
    if GUIGetMsg() = -3 Then Exit
    Next

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_PenDispose($Rot)
    _GDIPlus_PenDispose($Blau)
    _GDIPlus_PenDispose($Gruen)
    _GDIPlus_GraphicsDispose($Graphic)
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

    [/autoit]


    lof mit dem ding :D

  • Beweg die Maus dabei, und schon läufts schneller.....

  • Hier ein Beispiel von trancexx:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <Memory.au3>

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

    Opt("GUIOnEventMode", 1)

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

    Global Const $STM_SETIMAGE = 370

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

    Global Const $iWidth = 810
    Global Const $iHeight = 470

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

    GUICreate("", $iWidth, $iHeight)
    GUISetOnEvent(-3, "_Quit")
    GUISetBkColor(0)

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

    Global $hPic = GUICtrlCreatePic("", 0, 0, $iWidth, $iHeight)

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

    Global $iSize = $iWidth * $iHeight
    Global $tBits = DllStructCreate("int[" & $iSize & "]")
    Global $pBits = DllStructGetPtr($tBits)

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

    Global $hBitmap, $aCall, $iHMsg
    Global $hPicHandle = GUICtrlGetHandle($hPic)

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

    Global $tRandom = DllStructCreate("dword")
    Global $pRandom = DllStructGetPtr($tRandom)

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

    GUISetState()

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

    Global $aRtlRandomEx = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("ntdll.dll"), "str", "RtlRandomEx")
    Global $pRtlRandomEx = $aRtlRandomEx[0]

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

    Global $aRtlMoveMemory = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("kernel32.dll"), "str", "RtlMoveMemory")
    Global $pRtlMoveMemory = $aRtlMoveMemory[0]

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

    Global $aSendMessageW = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("user32.dll"), "str", "SendMessageW")
    Global $pSendMessageW = $aSendMessageW[0]

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

    Global $aDeleteObject = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("gdi32.dll"), "str", "DeleteObject")
    Global $pDeleteObject = $aDeleteObject[0]

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

    Global $aCreateBitmap = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("gdi32.dll"), "str", "CreateBitmap")
    Global $pCreateBitmap = $aCreateBitmap[0]

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

    Global $pRemoteCode = _MemVirtualAlloc(0, 512, $MEM_COMMIT, $PAGE_EXECUTE_READWRITE)

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

    Local $tCodeBuffer = DllStructCreate("byte[512]", $pRemoteCode)

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

    #Region Assemply
    DllStructSetData($tCodeBuffer, 1, _
    "0x" & _
    "33DB" & _ ; xor ebx, ebx
    "68" & SwapEndian($pRandom) & _ ; push $pRandom
    "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx
    "FFD0" & _ ; call eax
    "8BCB" & _ ; mov ecx, ebx
    "69C9" & SwapEndian(4) & _ ; imul ecx, 4
    "81C1" & SwapEndian($pBits) & _ ; add ecx, $pBits
    "68" & SwapEndian(3) & _ ; push 3 bytes
    "68" & SwapEndian($pRandom) & _ ; push $pRandom
    "51" & _ ; push ecx
    "B8" & SwapEndian($pRtlMoveMemory) & _ ; mov eax, RtlMoveMemory
    "FFD0" & _ ; call eax
    "43" & _ ; inc ebx
    "81FB" & SwapEndian($iSize) & _ ; cmp ebx, $iSize; <- compare ebx with $iSize
    "75" & Hex(256 - 53, 2) & _ ; jne -53 bytes; <- this is saying go back and do it again if not equal
    "68" & SwapEndian($pBits) & _ ; push $pBits
    "68" & SwapEndian(32) & _ ; push BitsPerPel
    "68" & SwapEndian(1) & _ ; push Planes
    "68" & SwapEndian($iHeight) & _ ; push $iHeight
    "68" & SwapEndian($iWidth) & _ ; push $iWidth
    "B8" & SwapEndian($pCreateBitmap) & _ ; mov eax, CreateBitmap
    "FFD0" & _ ; call eax
    "50" & _ ; push eax
    "68" & SwapEndian(0) & _ ; push IMAGE_BITMAP
    "68" & SwapEndian($STM_SETIMAGE) & _ ; push STM_SETIMAGE
    "68" & SwapEndian($hPicHandle) & _ ; push $hPicHandle
    "B8" & SwapEndian($pSendMessageW) & _ ; mov eax, SendMessageW
    "FFD0" & _ ; call eax
    "50" & _ ; push eax
    "B8" & SwapEndian($pDeleteObject) & _ ; mov eax, DeleteObject
    "FFD0" & _ ; call eax
    "C3" _ ; ret
    )
    #EndRegion Assembly

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

    While 1

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

    #region Assembly

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

    DllCall("user32.dll", "int", "CallWindowProcW", _
    "ptr", $pRemoteCode, _
    "int", 0, _
    "int", 0, _
    "int", 0, _
    "int", 0)

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

    #endregion Assembly

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

    Sleep(10)

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

    WEnd

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

    Func SwapEndian($iValue)
    Return Hex(Binary($iValue))
    EndFunc ;==>SwapEndian

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

    Func _Quit()
    Exit
    EndFunc ;==>_Quit

    [/autoit]


    Mit Inline Assembler :thumbup:

    Sprenger120: Benutze Opt("GUIOnEventMode", 1), damit dein Code schneller läuft!

    Gruß,
    UEZ

    PS: wenn man das Ding lang genug laufen lässt, besteht die Wahrscheinlichkeit ein Bild aus dem Universum der Bilder dargestellt zu bekommen, jedenfalls für einen Augenblick ;)

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Spoiler anzeigen
    [autoit]


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

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

    #Region StartUp
    Opt("GUIOnEventMode", 1)
    _GDIPlus_Startup()
    $Rot = _GDIPlus_PenCreate(0xFFFF0000)
    $Gruen = _GDIPlus_PenCreate(0xFF00FF00)
    $Blau = _GDIPlus_PenCreate(0xFF0000FF)
    #EndRegion StartUp

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

    #Region GUI
    $hGUI = GUICreate("RandomDraw", 640, 480, -1, -1)
    $Graphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    GUISetState(@SW_SHOW)
    #EndRegion GUI

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

    #Region Loop
    For $y = 1 To 479
    For $x = 0 To 639
    $Random = Random(1, 3, 1)
    Switch $Random
    Case 1
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Rot)
    Case 2
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Gruen)
    Case 3
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Blau)
    EndSwitch
    Next
    If GUIGetMsg() = -3 Then ExitFunc()
    Next

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    ExitFunc()
    EndSwitch
    WEnd
    #EndRegion Loop

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

    #Region Func's
    Func ExitFunc()
    _GDIPlus_PenDispose($Rot)
    _GDIPlus_PenDispose($Blau)
    _GDIPlus_PenDispose($Gruen)
    _GDIPlus_GraphicsDispose($Graphic)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>ExitFunc
    #EndRegion Func's

    [/autoit]

    Schneller + übersichtlicher :P


  • Da fehlt der Eintrag GUISetOnEvent($GUI_EVENT_CLOSE, "ExitFunc").

    Am besten vor GUISetState(@SW_SHOW) plazieren ;)

    Ach ja, und If GUIGetMsg() = -3 Then ExitFunc() benötigst du somit nicht mehr!

    D.h. auch der Inhalt der While Schleife ist überflüssig ->

    While Sleep(50)
    WEnd

    Spoiler anzeigen
    [autoit]


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

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

    #Region StartUp
    Opt("GUIOnEventMode", 1)
    _GDIPlus_Startup()
    $Rot = _GDIPlus_PenCreate(0xFFFF0000)
    $Gruen = _GDIPlus_PenCreate(0xFF00FF00)
    $Blau = _GDIPlus_PenCreate(0xFF0000FF)
    #EndRegion StartUp

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

    #Region GUI
    $hGUI = GUICreate("RandomDraw", 640, 480, -1, -1)
    $Graphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    GUISetOnEvent($GUI_EVENT_CLOSE, "ExitFunc")
    GUISetState(@SW_SHOW)
    #EndRegion GUI

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

    #Region Loop
    For $y = 1 To 479
    For $x = 0 To 639
    $Random = Random(1, 3, 1)
    Switch $Random
    Case 1
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Rot)
    Case 2
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Gruen)
    Case 3
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Blau)
    EndSwitch
    Next
    Next

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

    While Sleep(50)
    WEnd
    #EndRegion Loop

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

    #Region Func's
    Func ExitFunc()
    _GDIPlus_PenDispose($Rot)
    _GDIPlus_PenDispose($Blau)
    _GDIPlus_PenDispose($Gruen)
    _GDIPlus_GraphicsDispose($Graphic)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>ExitFunc
    #EndRegion Func's

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

    3 Mal editiert, zuletzt von UEZ (17. Dezember 2009 um 09:31)

  • Wenn wir grad eh dabei sind das kleine Script zu verbessern :D

    Spoiler anzeigen
    [autoit]


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

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

    #Region StartUp
    Opt("GUIOnEventMode", 1)
    _GDIPlus_Startup()
    $Rot = _GDIPlus_PenCreate(0xFFFF0000)
    $Gruen = _GDIPlus_PenCreate(0xFF00FF00)
    $Blau = _GDIPlus_PenCreate(0xFF0000FF)
    #EndRegion StartUp

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

    #Region GUI
    $hGUI = GUICreate("RandomDraw", 640, 480, -1, -1)
    $Graphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    GUISetOnEvent($GUI_EVENT_CLOSE, "ExitFunc")
    WinRunTrans($hGUI, "Show")
    #EndRegion GUI

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

    #Region Loop
    For $y = 1 To 479
    For $x = 0 To 639
    $Random = Random(1, 3, 1)
    Switch $Random
    Case 1
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Rot)
    Case 2
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Gruen)
    Case 3
    _GDIPlus_GraphicsDrawLine($Graphic, $x, $y, 1, $y, $Blau)
    EndSwitch
    Next
    Next

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

    While
    Sleep(50)
    WEnd
    #EndRegion Loop

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

    #Region Func's
    Func ExitFunc()
    WinRunTrans($hGUI, "Hide")
    _GDIPlus_PenDispose($Rot)
    _GDIPlus_PenDispose($Blau)
    _GDIPlus_PenDispose($Gruen)
    _GDIPlus_GraphicsDispose($Graphic)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>ExitFunc

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

    Func WinRunTrans($Window, $Mod)
    If $Mod = "Show" Then
    WinSetTrans($Window, "", 0)
    GUISetState(@SW_SHOW, $Window)
    For $i = 0 To 255 Step 5
    WinSetTrans($Window, "", $i)
    Sleep(10)
    Next
    ElseIf $Mod = "Hide" Then
    For $i = 255 To 0 Step -5
    WinSetTrans($Window, "", $i)
    Sleep(10)
    Next
    GUISetState(@SW_HIDE, $Window)
    EndIf
    EndFunc ;==>WinRunTrans
    #EndRegion Func's

    [/autoit]
  • While
    Sleep(50)
    WEnd

    funzt so nicht ;)

    UEZ

    Sicher funkt das. ;)
    Is ja im OnEventModus.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • So was ähnliches hab ich mal als SCR gemacht!
    Einfach compilieren, in *.scr umbenennen und starten (Tipp: rechts>Installieren)
    LINK

    MfG. tobi_girst

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »tobi_girst« (Morgen, 25:63)