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

Beiträge von Greek

  • Disco auf dem Desktop

    • Greek
    • 20. März 2009 um 15:21

    ^^

    Ich kann da noch viel mehr mitmachen =)

    Guck mal hier als Strich:

    Spoiler anzeigen
    [autoit]

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

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

    HotKeySet("{ESC}", "_ende")

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

    Global $ballpos1=@DesktopWidth/2
    Global $ballpos2=@DesktopHeight/2
    Global $BewegungSenkrecht=Random(5, 7, 1)
    Global $BewegungWagrecht=Random(5, 7, 1)
    Global $Speed=10

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

    _GDIPlus_Startup()

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

    Global $hGui = GUICreate("Rahmen", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
    GUISetBkColor(0xABCDEF)
    _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255)
    GUISetState()
    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    $Pinsel = _GDIPlus_PenCreate(0xFF0000FF, 20)
    Global $vanish = _GDIPlus_PenCreate(0xFF000000, 20)
    $t1 = _Timer_SetTimer(0, 300, "move")
    $begin=TimerInit()

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

    While 1
    Sleep(40)
    WEnd
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_BrushDispose($Pinsel)
    _GDIPlus_BrushDispose($vanish)

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

    Func _ende()
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_ende

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

    Func move($a, $b, $c, $d)
    _GDIPlus_GraphicsDrawLine ( $hGraphic, $ballpos1, $ballpos2, $ballpos1+50, $ballpos2+50, $vanish )
    $ballpos1+=$BewegungWagrecht * $Speed
    $ballpos2+=$BewegungSenkrecht * $Speed
    _GDIPlus_GraphicsDrawLine ( $hGraphic, $ballpos1, $ballpos2, $ballpos1+50, $ballpos2+50, $Pinsel )
    If $ballpos1 >= @DesktopWidth - 80 And $BewegungWagrecht > 0 Then $BewegungWagrecht = Random(-7, -5, 1)
    If $ballpos1 < 10 And $BewegungWagrecht < 0 Then $BewegungWagrecht = Random(5, 7, 1)
    If $ballpos2 >= @DesktopHeight - 95 And $BewegungSenkrecht > 0 Then $BewegungSenkrecht = Random(-7, -5, 1)
    If $ballpos2 < 30 And $BewegungSenkrecht < 0 Then $BewegungSenkrecht = Random(5, 7, 1)
    If _GDIPlus_PenGetColor ( $vanish )=0xFF000000 Then
    _GDIPlus_PenSetColor ( $vanish, 0xFFFFFF00 )
    ElseIf _GDIPlus_PenGetColor ( $vanish )=0xFFFFFF00 Then
    _GDIPlus_PenSetColor ( $vanish, 0xFFFF0000 )
    ElseIf _GDIPlus_PenGetColor ( $vanish )=0xFFFF0000 Then
    _GDIPlus_PenSetColor ( $vanish, 0xFF00FF00 )
    ElseIf _GDIPlus_PenGetColor ( $vanish )=0xFF00FF00 Then
    _GDIPlus_PenSetColor ( $vanish, 0xFF000000 )
    EndIf
    $dif=TimerDiff( $begin )
    If $dif>12000 Then
    _GDIPlus_GraphicsClear ( $hGraphic, 0xFFABCDEF )
    $begin=TimerInit()
    EndIf
    EndFunc ;==>move

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

    [/autoit]
  • Disco auf dem Desktop

    • Greek
    • 20. März 2009 um 14:39

    Das war eigentlich extra so, damit es nicht zu sehr stört ^^

  • Run("notepad") wird in Endlosschleife geöffnet

    • Greek
    • 19. März 2009 um 21:31

    Was soll den Sonst passieren, wenn du es in eine While tust 8|

  • Disco auf dem Desktop

    • Greek
    • 19. März 2009 um 20:51

    Wenn ihr ordentlich Disco wollt, macht das hier ;)
    ( ESC beenden )

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GDIPlus.au3>
    #include <timers.au3>
    #include <misc.au3>

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

    $dll = DllOpen("user32.dll")

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

    Global $ballpos1=@DesktopWidth/2
    Global $ballpos2=@DesktopHeight/2
    Global $BewegungSenkrecht=Random(5, 7, 1)
    Global $BewegungWagrecht=Random(5, 7, 1)
    Global $Speed=10

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

    _GDIPlus_Startup()

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

    Global $hGui = GUICreate("Rahmen", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
    GUISetBkColor(0xABCDEF)
    _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255)
    GUISetState()
    Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
    $Pinsel = _GDIPlus_PenCreate(0xFF0000FF, 20)
    Global $vanish = _GDIPlus_PenCreate(0xFF000000, 20)
    $t1 = _Timer_SetTimer(0, 20, "move")
    $begin=TimerInit()

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

    AdlibRegister( "_check", 50 )

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

    While 1
    $nmsg=GUIGetMsg()
    Switch $nmsg
    Case $gui_event_close
    Exit
    EndSwitch
    WEnd

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

    Func _ende()
    _GDIPlus_GraphicsClear ( $hGraphic, 0xFFABCDEF )
    _GDIPlus_PenDispose($Pinsel)
    _GDIPlus_PenDispose($vanish)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_ende

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

    Func move($a, $b, $c, $d)
    _GDIPlus_GraphicsDrawArc ( $hGraphic, $ballpos1, $ballpos2, 70, 70, 180, 360, $vanish )
    $ballpos1+=$BewegungWagrecht * $Speed
    $ballpos2+=$BewegungSenkrecht * $Speed
    _GDIPlus_GraphicsDrawArc ( $hGraphic, $ballpos1, $ballpos2, 70, 70, 180, 360, $Pinsel )
    If $ballpos1 >= @DesktopWidth - 80 And $BewegungWagrecht > 0 Then $BewegungWagrecht = Random(-7, -5, 1)
    If $ballpos1 < 10 And $BewegungWagrecht < 0 Then $BewegungWagrecht = Random(5, 7, 1)
    If $ballpos2 >= @DesktopHeight - 95 And $BewegungSenkrecht > 0 Then $BewegungSenkrecht = Random(-7, -5, 1)
    If $ballpos2 < 30 And $BewegungSenkrecht < 0 Then $BewegungSenkrecht = Random(5, 7, 1)
    If _GDIPlus_PenGetColor ( $vanish )=0xFF000000 Then
    _GDIPlus_PenSetColor ( $vanish, 0xFFFFFF00 )
    ElseIf _GDIPlus_PenGetColor ( $vanish )=0xFFFFFF00 Then
    _GDIPlus_PenSetColor ( $vanish, 0xFFFF0000 )
    ElseIf _GDIPlus_PenGetColor ( $vanish )=0xFFFF0000 Then
    _GDIPlus_PenSetColor ( $vanish, 0xFF00FF00 )
    ElseIf _GDIPlus_PenGetColor ( $vanish )=0xFF00FF00 Then
    _GDIPlus_PenSetColor ( $vanish, 0xFF000000 )
    EndIf
    $dif=TimerDiff( $begin )
    If $dif>12000 Then
    _GDIPlus_GraphicsClear ( $hGraphic, 0xFFABCDEF )
    $begin=TimerInit()
    EndIf
    EndFunc ;==>move

    [/autoit]

    Hat fast keine CPU Auslastung! Könnt ihr den ganzen Tag anlassen wenn ihr es Aushaltet ;)

  • Gmx Mail mit autoit geht ned pls help

    • Greek
    • 19. März 2009 um 20:18

    Oder guck dir das mal an, damit verstehst du es bestimmt =)

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.3.0.0
    Author: Greek

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here

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

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Email versender", 396, 294, 1153, 185)
    $Input1 = GUICtrlCreateInput("", 8, 40, 121, 21)
    $Input2 = GUICtrlCreateInput("", 248, 40, 121, 21)
    $Label1 = GUICtrlCreateLabel("Mail sever: Für http://www.web.de ist er smtp.web.de ", 8, 16, 229, 17)
    $Label2 = GUICtrlCreateLabel("Name des Absenders", 248, 16, 105, 17)
    $Label3 = GUICtrlCreateLabel("Absender email addresse", 8, 72, 122, 17)
    $Input3 = GUICtrlCreateInput("", 8, 96, 121, 21)
    $Input4 = GUICtrlCreateInput("", 248, 96, 121, 21)
    $Label4 = GUICtrlCreateLabel("Empfänger email addresse", 248, 72, 128, 17)
    $Input5 = GUICtrlCreateInput("", 8, 152, 121, 21)
    $Label5 = GUICtrlCreateLabel("Betreff", 8, 128, 35, 17)
    $Label6 = GUICtrlCreateLabel(" Text ", 248, 128, 34, 17)
    $Input6 = GUICtrlCreateInput("", 248, 152, 121, 21)
    $Label7 = GUICtrlCreateLabel("Nochmal Absender email", 8, 184, 121, 17)
    $Input7 = GUICtrlCreateInput("", 8, 208, 121, 21)
    $Input8 = GUICtrlCreateInput("", 248, 208, 121, 21)
    $Label8 = GUICtrlCreateLabel("Passwort der Absender email", 248, 184, 140, 17)
    $Button1 = GUICtrlCreateButton("Email versenden", 152, 248, 100, 25, 0)
    $Button2 = GUICtrlCreateButton("Abbrechen", 312, 256, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $rc = _INetSmtpMailCom(GUICtrlRead( $Input1),GUICtrlRead($Input2),GUICtrlRead($Input3), GUICtrlRead($Input4), GUICtrlRead($Input5), GUICtrlRead($Input6), "", "","", GUICtrlRead($Input7), GUICtrlRead($Input8))
    If @error then
    msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)
    EndIf
    Case $Button2
    Exit
    EndSwitch
    WEnd

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


    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "")
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Cc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
    $objEmail.HTMLBody = $as_Body
    Else
    $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $ex = 1 To $S_Files2Attach[0]
    $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
    If FileExists($S_Files2Attach[$x]) Then
    $objEmail.AddAttachment ($S_Files2Attach[$x])
    Else
    $i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
    SetError(1)
    return 0
    EndIf
    Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    ;Authenticated SMTP
    If $s_Username <> "" Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    ;Update settings
    $objEmail.Configuration.Fields.Update
    ; Sent the Message
    $objEmail.Send
    if @error then
    SetError(2)
    return $oMyRet[1]
    EndIf
    EndFunc;==>_INetSmtpMailCom
    ;
    ;
    ; Com Error Handler
    Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description,3)
    ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
    EndFunc;==>MyErrFunc

    [/autoit]
  • Was macht die DLL Funktion SetLayeredWindowAttributes ?

    • Greek
    • 19. März 2009 um 16:00

    Thx^^

    Jetzt hab ich aber noch nen Problem:
    _GDIPlus_GraphicClear hat ne mega Systems Auslastung

    Vergleicht mal:

    Spoiler anzeigen
    [autoit]

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

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

    HotKeySet ( "{ESC}", "_ende" )

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

    Global $ballpos1=@DesktopWidth/2
    Global $ballpos2=@DesktopHeight/2
    Global $BewegungSenkrecht=Random(5, 7, 1)
    Global $BewegungWagrecht=Random(5, 7, 1)
    Global $Speed=0.5

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

    _GDIPlus_Startup()

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

    $hGui = GUICreate("Rahmen", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
    GUISetBkColor(0xABCDEF)
    _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255)
    GUISetState()

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

    $hGraphic= _GDIPlus_GraphicsCreateFromHWND ($hGui)
    $Pinsel=_GDIPlus_PenCreate ( 0xFF0000FF, 20 )

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

    _GDIPlus_GraphicsDrawArc ( $hGraphic, $ballpos1, $ballpos2, 70, 70, 180, 360, $Pinsel )

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

    AdlibEnable ( "_Zyklus", 10 )

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

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

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

    Func _ende()
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; Von progandy Thx^^
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _Bewegen()
    _GDIPlus_GraphicsClear ( $hGraphic, 0xFFABCDEF )
    $ballpos1+=$BewegungWagrecht * $Speed
    $ballpos2+=$BewegungSenkrecht * $Speed
    _GDIPlus_GraphicsDrawArc ( $hGraphic, $ballpos1, $ballpos2, 70, 70, 180, 360, $Pinsel )
    EndFunc

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

    Func _Collision()
    If $ballpos1 >= @DesktopWidth - 80 And $BewegungWagrecht > 0 Then $BewegungWagrecht = Random(-7, -5, 1)
    If $ballpos1 < 10 And $BewegungWagrecht < 0 Then $BewegungWagrecht = Random(5, 7, 1)
    If $ballpos2 >= @DesktopHeight - 95 And $BewegungSenkrecht > 0 Then $BewegungSenkrecht = Random(-7, -5, 1)
    If $ballpos2 < 30 And $BewegungSenkrecht < 0 Then $BewegungSenkrecht = Random(5, 7, 1)
    EndFunc

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

    Func _Zyklus()
    _Bewegen()
    _Collision()
    EndFunc

    [/autoit]

    Mit

    Spoiler anzeigen
    [autoit]

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

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

    HotKeySet ( "{ESC}", "_ende" )

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

    Global $ballpos1=@DesktopWidth/2
    Global $ballpos2=@DesktopHeight/2
    Global $BewegungSenkrecht=Random(5, 7, 1)
    Global $BewegungWagrecht=Random(5, 7, 1)
    Global $Speed=0.5

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

    _GDIPlus_Startup()

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

    $hGui = GUICreate("Rahmen", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
    GUISetBkColor(0xABCDEF)
    _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255)
    GUISetState()

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

    $hGraphic= _GDIPlus_GraphicsCreateFromHWND ($hGui)
    $Pinsel=_GDIPlus_PenCreate ( 0xFF0000FF, 20 )

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

    _GDIPlus_GraphicsDrawArc ( $hGraphic, $ballpos1, $ballpos2, 70, 70, 180, 360, $Pinsel )

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

    AdlibEnable ( "_Zyklus", 10 )

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

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

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

    Func _ende()
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; Von progandy Thx^^
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Func _Bewegen()
    ;~ _GDIPlus_GraphicsClear ( $hGraphic, 0xFFABCDEF )
    $ballpos1+=$BewegungWagrecht * $Speed
    $ballpos2+=$BewegungSenkrecht * $Speed
    _GDIPlus_GraphicsDrawArc ( $hGraphic, $ballpos1, $ballpos2, 70, 70, 180, 360, $Pinsel )
    EndFunc

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

    Func _Collision()
    If $ballpos1 >= @DesktopWidth - 80 And $BewegungWagrecht > 0 Then $BewegungWagrecht = Random(-7, -5, 1)
    If $ballpos1 < 10 And $BewegungWagrecht < 0 Then $BewegungWagrecht = Random(5, 7, 1)
    If $ballpos2 >= @DesktopHeight - 95 And $BewegungSenkrecht > 0 Then $BewegungSenkrecht = Random(-7, -5, 1)
    If $ballpos2 < 30 And $BewegungSenkrecht < 0 Then $BewegungSenkrecht = Random(5, 7, 1)
    EndFunc

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

    Func _Zyklus()
    _Bewegen()
    _Collision()
    EndFunc

    [/autoit]

    Mit _GDIPlus_GraphicClear hab ich ca 64% Auslastung
    Brauch irendwie ne andere Methode um den Kreis verschwinden zu lassen
    ( Sieht Lustig aus wie der den Bildschirm vollmalt ^^ )

  • Was macht die DLL Funktion SetLayeredWindowAttributes ?

    • Greek
    • 19. März 2009 um 15:13

    Yippi hab endlich nen Weg gefunden!

    Spoiler anzeigen
    [autoit]

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

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

    HotKeySet ( "{ESC}", "_ende" )

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

    _GDIPlus_Startup()

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

    $hGui = GUICreate("Rahmen", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
    _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255)
    $label1=GUICtrlCreateLabel( "", 0, 0, @DesktopWidth, @DesktopHeight )
    GUICtrlSetBkColor(-1, 0xABCDEF)
    GUISetState()

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

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGui)
    $Pinsel=_GDIPlus_PenCreate ( 0xFF0000FF, 20 )

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

    _GDIPlus_GraphicsDrawArc ( $hGraphic, @DesktopWidth/2, @DesktopHeight/2, 70, 70, 180, 360, $Pinsel )

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

    Sleep ( 2000 )

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

    _GDIPlus_GraphicsClear ( $hGraphic, 0xFFABCDEF )

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

    While 1
    WEnd

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

    Func _ende()
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; progandy
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

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

    Shellexecute (@MyDocumentsDir & "\Eigene Musik\musik.m3u")
    ShellExecute ( "musik.m3u", "", @MyDocumentsDir & "\Eigene Musik" )

    [/autoit]

    Edit:

    Noch eine Frage, kann ich das mit dem Label anders machen? Also brauch ich das überhaupt? Funzt nämlich nicht ohne.

  • Was macht die DLL Funktion SetLayeredWindowAttributes ?

    • Greek
    • 18. März 2009 um 18:37
    Zitat von L3viathan2142

    Ne andere Farbe setzen?

    Ja in meinem Pong spiel geht das so, weil der Hintergrund schwarz ist, aber es soll ja das Desktop Hintergrund Bild wieder kommen :S

  • Was macht die DLL Funktion SetLayeredWindowAttributes ?

    • Greek
    • 18. März 2009 um 18:20

    Wie kann ich das Ding jetzt eigentlich wieder löschen?

  • Was macht die DLL Funktion SetLayeredWindowAttributes ?

    • Greek
    • 18. März 2009 um 18:00

    Super Funktion, da kann man ja jetzt sau geil Rummalen =D

    Spoiler anzeigen
    [autoit]

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

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

    HotKeySet ( "{ESC}", "_ende" )

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

    _GDIPlus_Startup()

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

    $hGui = GUICreate("Rahmen", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
    _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255)
    GUICtrlCreateLabel( "", 0, 0, @DesktopWidth, @DesktopHeight )
    GUICtrlSetBkColor(-1, 0xABCDEF)
    GUISetState()

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

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGui)
    $Pinsel=_GDIPlus_PenCreate ( 0xFF0000FF, 20 )

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

    _GDIPlus_GraphicsDrawArc ( $hGraphic, @DesktopWidth/2, @DesktopHeight/2, 70, 70, 180, 360, $Pinsel )

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

    While 1
    WEnd

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

    Func _ende()
    _GDIPlus_Shutdown()
    Exit
    EndFunc

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

    Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
    ; Von progandy Thx^^
    If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
    If Not $isColorRef Then
    $i_transcolor = Hex(String($i_transcolor), 6)
    $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
    EndIf
    Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
    Select
    Case @error
    Return SetError(@error, 0, 0)
    Case $Ret[0] = 0
    Return SetError(4, _WinAPI_GetLastError(), 0)
    Case Else
    Return 1
    EndSelect
    EndFunc ;==>_WinAPI_SetLayeredWindowAttributes

    [/autoit]
  • Gui nur manchmal transparent

    • Greek
    • 13. März 2009 um 18:26

    Guck euch mal PSPWaveDesktop an, er hat auch kein WinSetTrans benutzt

    $WS_EX_TRANSPARENT gibts doch nicht zum Spaß?

  • Gui nur manchmal transparent

    • Greek
    • 13. März 2009 um 18:13
    Zitat

    $hWnd = WinGetHandle("Sonne")

    So stehts aber in der Hilfe,

    weiß einer warum das bei mir nur manchmal transparent ist?

  • Gui nur manchmal transparent

    • Greek
    • 13. März 2009 um 17:57

    Hallo, warum ist dieses Gui nur manchmal transparent? Jedes 2te mal...

    Spoiler anzeigen
    [autoit]

    #NoTrayIcon

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

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

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

    HotKeySet ( "{ESC}", "_ende" )

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

    _GDIPlus_Startup()

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

    $hGui=GUICreate ( "Sonne", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TRANSPARENT )
    $hWnd = WinGetHandle("Sonne")
    GUISetState ()

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

    $hGraphic=_GDIPlus_GraphicsCreateFromHWND( $hwnd )
    $Pinsel=_GDIPlus_PenCreate ( 0xFFFFFF00, 10, 2 )
    _GDIPlus_GraphicsDrawArc ( $hGraphic, @DesktopWidth/1.1, -5, 170, 170, 0, 260, $Pinsel )

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

    While 1
    WEnd

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

    Func _ende()
    _GDIPlus_PenDispose ( $Pinsel )
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

    [/autoit]
  • Pixel Farbe auslesen

    • Greek
    • 12. März 2009 um 16:31

    In ne schleife tun , so z.B.

    [autoit]

    $go=0
    Do
    Send ("{enter}")
    Sleep (2000)
    $go+=1
    Until $go=5

    [/autoit]
  • Pixel Farbe auslesen

    • Greek
    • 12. März 2009 um 15:44
    Zitat

    PixelGetColor
    --------------------------------------------------------------------------------

    Gibt die Pixelfarbe von einer entsprechenden x,y-Koordinate wieder.


    PixelGetColor ( x , y )


    Parameter

    x X-Koordinate des Pixels.
    y Y-Koordinate des Pixels.


    Rückgabewert

    Erfolg: Gibt den dezimalen Wert der Pixelfarbe zurück.
    Fehler: Gibt -1 zurück, bei ungültigen Koordinaten.

    Alles anzeigen

    Was gibts da nicht zu verstehen ?(

  • Pixel Farbe auslesen

    • Greek
    • 12. März 2009 um 15:12
    [autoit]

    PixelGetColor

    [/autoit]

    wahrscheinlich ;)

  • GUICtrlCreateEdit Frage

    • Greek
    • 10. März 2009 um 15:37
    Spoiler anzeigen
    [autoit]

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

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 633, 447, 193, 125)
    $Edit1 = GUICtrlCreateEdit("", 192, 136, 185, 89, $WS_VSCROLL)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

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

    EndSwitch
    WEnd

    [/autoit]
  • Rand eies GUI

    • Greek
    • 9. März 2009 um 19:15

    Ich glaub da gibts keinen style dafür...
    Hab so ziemlich alles durchprobiert und kombiniert aber nix gefunden, jemand ne Idee?

  • Rand eies GUI

    • Greek
    • 9. März 2009 um 18:52

    Dann nimm

    [autoit]

    $WS_BORDER

    [/autoit]


    da ist der Rand noch da, aber die 3 Symbole weg.

  • Senden

    • Greek
    • 9. März 2009 um 16:22

    Du willst also Speichern und Laden?

    Spoiler anzeigen
    [autoit]

    ;~ Speichern und Laden Author Greek

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

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

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Cfg Loader", 315, 114, 553, 227)
    $Button1 = GUICtrlCreateButton("Load Cfg", 8, 8, 139, 41, 0)
    $Button2 = GUICtrlCreateButton("Save Cfg", 160, 8, 139, 41, 0)
    $Button3 = GUICtrlCreateButton("Beenden", 120, 80, 75, 25, 0)
    $input = GUICtrlCreateInput ( "", 20, 70, 70, 20 )
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    If Not FileExists ( "cfg.ini" ) Then
    MsgBox ( 0, "cfg fehlt", "Config erst anlegen bitte" )
    Else
    $hallo=IniRead ( "cfg.ini", "sachen", "daten", "nicht gefunden" )
    MsgBox ( 0, "Inhalt", $hallo )
    EndIf
    Case $Button2
    $inhalt = GUICtrlRead ( $input )
    IniWriteSection ( "cfg.ini", "sachen", "daten="&$inhalt )
    Case $Button3
    Exit

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

    EndSwitch
    WEnd

    [/autoit]

    Edit:
    Also wie im ICQ besprochen

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Email versender", 406, 304)

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

    $1= GUICtrlCreateMenu("Mail Server")
    $fileitem = GUICtrlCreateMenuItem("Server festlegen", $1)

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

    $Input1 = GUICtrlCreateInput("", 8, 40, 121, 21)
    $Input2 = GUICtrlCreateInput("", 248, 40, 121, 21)
    $Label1 = GUICtrlCreateLabel("Mail sever: Für http://www.web.de ist er smtp.web.de ", 8, 16, 229, 17)
    $Label2 = GUICtrlCreateLabel("Name des Absenders", 248, 16, 105, 17)
    $Label3 = GUICtrlCreateLabel("Absender email addresse", 8, 72, 122, 17)
    $Input3 = GUICtrlCreateInput("", 8, 96, 121, 21)
    $Input4 = GUICtrlCreateInput("", 248, 96, 121, 21)
    $Label4 = GUICtrlCreateLabel("Empfänger email addresse", 248, 72, 128, 17)
    $Input5 = GUICtrlCreateInput("", 8, 152, 121, 21)
    $Label5 = GUICtrlCreateLabel("Betreff", 8, 128, 35, 17)
    $Label6 = GUICtrlCreateLabel(" Text ", 248, 128, 34, 17)
    $Input6 = GUICtrlCreateInput("", 248, 152, 121, 21)
    $Label7 = GUICtrlCreateLabel("Nochmal Absender email", 8, 184, 121, 17)
    $Input7 = GUICtrlCreateInput("", 8, 208, 121, 21)
    $Input8 = GUICtrlCreateInput("", 248, 208, 121, 21)
    $Label8 = GUICtrlCreateLabel("Passwort der Absender email", 248, 184, 140, 17)
    $Button1 = GUICtrlCreateButton("Email versenden", 152, 248, 100, 25, 0)
    $Button2 = GUICtrlCreateButton("Abbrechen", 312, 256, 75, 25, 0)

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

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    If Not FileExists ( "cfg.ini" ) Then
    MsgBox ( 0, "cfg fehlt", "Config erst anlegen bitte" )
    Else
    $server=IniRead ( "cfg.ini", "sachen", "daten", "nicht gefunden" )
    EndIf
    $rc = _INetSmtpMailCom($server,GUICtrlRead($Input2),GUICtrlRead($Input3), GUICtrlRead($Input4), GUICtrlRead($Input5), GUICtrlRead($Input6), "", "","", GUICtrlRead($Input7), GUICtrlRead($Input8))
    If @error then
    msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)
    EndIf
    Case $Button2
    Exit
    Case $fileitem
    _ServerAbfragen()
    EndSwitch
    WEnd

    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "")
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Cc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
    $objEmail.HTMLBody = $as_Body
    Else
    $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $ex = 1 To $S_Files2Attach[0]
    $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
    If FileExists($S_Files2Attach[$x]) Then
    $objEmail.AddAttachment ($S_Files2Attach[$x])
    Else
    $i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
    SetError(1)
    return 0
    EndIf
    Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    ;Authenticated SMTP
    If $s_Username <> "" Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    ;Update settings
    $objEmail.Configuration.Fields.Update
    ; Sent the Message
    $objEmail.Send
    if @error then
    SetError(2)
    return $oMyRet[1]
    EndIf
    EndFunc;==>_INetSmtpMailCom
    ;
    ;
    ; Com Error Handler
    Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description,3)
    ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
    EndFunc;==>MyErrFunc

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

    Func _ServerAbfragen()
    $returnServer=InputBox ( "Server eingeben", "Server, z.B. smtp.web.de" )
    IniWriteSection ( "cfg.ini", "sachen", "daten="&$returnServer )
    EndFunc

    [/autoit]

    Kann sein das noch ein Fehler drin ist, probiers mal aus.

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™