Aber bei dir Beept es, deswegen wollt ich deins nicht nehmen, kann man das wegmachen?
Beiträge von Greek
-
-
Spoiler anzeigen
[autoit]#Include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>HotKeySet ( "{ESC}", "_ende" )
[/autoit] [autoit][/autoit] [autoit]
Global $schlaegerschnelle=10
Global $Strichpos1=@DesktopHeight/2-70
Global $Strichpos2=@DesktopHeight/2+70
Global $Titel="Pong"
Global $Rahmenbreite = 10
Global $dll = DllOpen("user32.dll")
_GDIPlus_Startup()Global $hGUI = GUICreate( $Titel , @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
[/autoit] [autoit][/autoit] [autoit]
Global $hwnd = WinGetHandle($Titel)
GUISetBkColor(0x0)
$Willkommen=GUICtrlCreateLabel ( "Willkommen bei Pong made by Greek", @DesktopWidth/4, @DesktopHeight/2-150, 1000, 200 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)
GUISetState(@SW_SHOW)Do
[/autoit] [autoit][/autoit] [autoit]
Sleep ( 100 )
Until _IsPressed ( "0D", $dll ) Or _IsPressed ( "20", $dll )GUICtrlSetState ( $Willkommen, $GUI_HIDE )
[/autoit] [autoit][/autoit] [autoit]$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$hpen_Del = _GDIPlus_PenCreate (0xFF000000, 15, 2)
$hPenRahmen = _GDIPlus_PenCreate (0xFF0000FF, 15, 2)
$hPen = _GDIPlus_PenCreate (0xFFFFFFFF, 15, 2)
$startschlaegerL=_GDIPlus_GraphicsDrawLine ($hGraphic, 100, $Strichpos1, 100, $Strichpos2, $hPen)
$startschlaegerR=_GDIPlus_GraphicsDrawLine ($hGraphic, @DesktopWidth-100, $Strichpos1, @DesktopWidth-100, $Strichpos2, $hPen)
_DrawRahmen()
$Spielstand=GUICtrlCreateLabel ( "0:0", @DesktopWidth/2, @DesktopHeight/15, 100, 100 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)HotKeySet( "w", "_hochL" )
[/autoit] [autoit][/autoit] [autoit]
HotKeySet( "s", "_runterL" )
HotKeySet( "{UP}", "_hochR" )
HotKeySet( "{DOWN}", "_runterR" )While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc _ende()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Shutdown()
Exit
EndFuncFunc _DrawRahmen()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawLine($hGraphic, $Rahmenbreite / 2, 0, $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, $Rahmenbreite / 2, @DesktopWidth, $Rahmenbreite / 2, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, @DesktopWidth - $Rahmenbreite / 2, 0, @DesktopWidth - $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, @DesktopHeight - $Rahmenbreite / 2, @DesktopWidth, @DesktopHeight - $Rahmenbreite / 2, $hPenRahmen)
EndFunc ;==>_DrawRahmenFunc _hochL()
[/autoit] [autoit][/autoit] [autoit]
While _IsPressed ( "57", $dll )
_GDIPlus_Graphicsdrawline($hGraphic,100,$strichpos1,100,$strichpos2,$hpen_del)
If $Strichpos1 >= 25 then
$strichpos1=$strichpos1-10
$strichpos2=$strichpos2-10
EndIf
_GDIPlus_GraphicsDrawLine ($hGraphic, 100, $Strichpos1, 100, $Strichpos2, $hPen)
Sleep($schlaegerschnelle)
WEnd
EndFuncFunc _runterL()
[/autoit] [autoit][/autoit] [autoit]
While _IsPressed ( "53", $dll )
_GDIPlus_Graphicsdrawline($hGraphic,100,$strichpos1,100,$strichpos2,$hpen_del)
If $Strichpos2 <= @DesktopHeight-25 then
$strichpos2=$strichpos2+10
$strichpos1=$strichpos1+10
EndIf
_GDIPlus_GraphicsDrawLine ($hGraphic, 100, $Strichpos1, 100, $Strichpos2, $hPen)
Sleep($schlaegerschnelle)
WEnd
EndFuncFunc _hochR()
[/autoit] [autoit][/autoit] [autoit]
While _IsPressed ( "57", $dll )
_GDIPlus_Graphicsdrawline($hGraphic,@DesktopWidth-100,$strichpos1,@DesktopWidth-100,$strichpos2,$hpen_del)
If $Strichpos1 >= 25 then
$strichpos1=$strichpos1-10
$strichpos2=$strichpos2-10
EndIf
_GDIPlus_GraphicsDrawLine ($hGraphic, @DesktopWidth-100, $Strichpos1, @DesktopWidth-100, $Strichpos2, $hPen)
Sleep($schlaegerschnelle)
WEnd
EndFuncFunc _runterR()
[/autoit]
While _IsPressed ( "53", $dll )
_GDIPlus_Graphicsdrawline($hGraphic,@DesktopWidth-100,$strichpos1,@DesktopWidth-100,$strichpos2,$hpen_del)
If $Strichpos2 <= @DesktopHeight-25 then
$strichpos2=$strichpos2+10
$strichpos1=$strichpos1+10
EndIf
_GDIPlus_GraphicsDrawLine ($hGraphic, @DesktopWidth-100, $Strichpos1, @DesktopWidth-100, $Strichpos2, $hPen)
Sleep($schlaegerschnelle)
WEnd
EndFuncWarum geht der Rechte nicht? Wenn ich ganz viele Tasten aufeinmal drück, passiert auch bei dem Rechtem was O.o
funkey
Mit _IsPressed beept das voll, kann man das wegmachen? -
kk, dann übermal ich eben nur alles, dachte es ging auch anders..
-
Oh ja da war was mit dem Variablen namen falsch
aber so:
Spoiler anzeigen
[autoit]#Include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>HotKeySet ( "{ESC}", "_ende" )
[/autoit] [autoit][/autoit] [autoit]
Global $Strichpos1=@DesktopHeight/2-70
Global $Strichpos2=@DesktopHeight/2+70
Global $Titel="Pong"
Global $Rahmenbreite = 10
Global $dll = DllOpen("user32.dll")
_GDIPlus_Startup()Global $hGUI = GUICreate( $Titel , @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
[/autoit] [autoit][/autoit] [autoit]
Global $hwnd = WinGetHandle($Titel)
GUISetBkColor(0x0)
$Willkommen=GUICtrlCreateLabel ( "Willkommen bei Pong made by Greek", @DesktopWidth/4, @DesktopHeight/2-150, 1000, 200 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)
GUISetState(@SW_SHOW)Do
[/autoit] [autoit][/autoit] [autoit]
Sleep ( 100 )
Until _IsPressed ( "0D", $dll ) Or _IsPressed ( "20", $dll )GUICtrlSetState ( $Willkommen, $GUI_HIDE )
[/autoit] [autoit][/autoit] [autoit]$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$hPenRahmen = _GDIPlus_PenCreate (0xFF0000FF, 15, 2)
$hPen = _GDIPlus_PenCreate (0xFFFFFFFF, 15, 2)
$startschlaegerL=_GDIPlus_GraphicsDrawLine ($hGraphic, 100, $Strichpos1, 100, $Strichpos2, $hPen)
$startschlaegerR=_GDIPlus_GraphicsDrawLine ($hGraphic, @DesktopWidth-100, $Strichpos1, @DesktopWidth-100, $Strichpos2, $hPen)
_DrawRahmen()
$Spielstand=GUICtrlCreateLabel ( "0:0", @DesktopWidth/2, @DesktopHeight/15, 100, 100 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)HotKeySet( "w", "_hoch" )
[/autoit] [autoit][/autoit] [autoit]
HotKeySet( "s", "_runter" )While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc _ende()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Shutdown()
Exit
EndFuncFunc _DrawRahmen()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawLine($hGraphic, $Rahmenbreite / 2, 0, $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, $Rahmenbreite / 2, @DesktopWidth, $Rahmenbreite / 2, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, @DesktopWidth - $Rahmenbreite / 2, 0, @DesktopWidth - $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, @DesktopHeight - $Rahmenbreite / 2, @DesktopWidth, @DesktopHeight - $Rahmenbreite / 2, $hPenRahmen)
EndFunc ;==>_DrawRahmenFunc _hoch()
[/autoit] [autoit][/autoit] [autoit]
;~ While _IsPressed ( "57", $dll )
;~ _GDIPlus_GraphicsClear($startschlaegerL,0xFF000000)
$hb = _GDIPlus_ImageGetGraphicsContext ($startschlaegerL)
_GDIPlus_GraphicsClear ($hb)
;~ WEnd
EndFuncFunc _runter()
[/autoit]
EndFuncFunzt es auch nicht

-
Ich will aber GDI+ lernen

azunai:
Blau sieht echt besser aus
Aber die Methode ist halt komisch^^ Man muss das irgendwie löschen können, statt es einfach zu übermalen...
-
Jetzt löscht der alles xD, was mach ich da Falsch?
Spoiler anzeigen
[autoit]#Include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>HotKeySet ( "{ESC}", "_ende" )
[/autoit] [autoit][/autoit] [autoit]
Global $Strichpos1=@DesktopHeight/2-70
Global $Strichpos2=@DesktopHeight/2+70
Global $Titel="Pong"
Global $Rahmenbreite = 10
Global $dll = DllOpen("user32.dll")
_GDIPlus_Startup()Global $hGUI = GUICreate( $Titel , @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
[/autoit] [autoit][/autoit] [autoit]
Global $hwnd = WinGetHandle($Titel)
GUISetBkColor(0x0)
$Willkommen=GUICtrlCreateLabel ( "Willkommen bei Pong made by Greek", @DesktopWidth/4, @DesktopHeight/2-150, 1000, 200 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)
GUISetState(@SW_SHOW)Do
[/autoit] [autoit][/autoit] [autoit]
Sleep ( 100 )
Until _IsPressed ( "0D", $dll ) Or _IsPressed ( "20", $dll )GUICtrlSetState ( $Willkommen, $GUI_HIDE )
[/autoit] [autoit][/autoit] [autoit]$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$hPenRahmen = _GDIPlus_PenCreate (0xFF00FF00, 15, 2)
$hPen = _GDIPlus_PenCreate (0xFFFFFFFF, 15, 2)
$startschlaegerL=_GDIPlus_GraphicsDrawLine ($hGraphic, 100, $Strichpos1, 100, $Strichpos2, $hPen)
$startschlaegerR=_GDIPlus_GraphicsDrawLine ($hGraphic, @DesktopWidth-100, $Strichpos1, @DesktopWidth-100, $Strichpos2, $hPen)
_DrawRahmen()
$Spielstand=GUICtrlCreateLabel ( "0:0", @DesktopWidth/2, @DesktopHeight/15, 100, 100 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)HotKeySet( "w", "_hoch" )
[/autoit] [autoit][/autoit] [autoit]
HotKeySet( "s", "_runter" )While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc _ende()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Shutdown()
Exit
EndFuncFunc _DrawRahmen()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawLine($hGraphic, $Rahmenbreite / 2, 0, $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, $Rahmenbreite / 2, @DesktopWidth, $Rahmenbreite / 2, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, @DesktopWidth - $Rahmenbreite / 2, 0, @DesktopWidth - $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, @DesktopHeight - $Rahmenbreite / 2, @DesktopWidth, @DesktopHeight - $Rahmenbreite / 2, $hPenRahmen)
EndFunc ;==>_DrawRahmenFunc _hoch()
[/autoit] [autoit][/autoit] [autoit]
;~ While _IsPressed ( "57", $dll )
;~ _GDIPlus_GraphicsClear($startschlaegerL,0xFF000000)
$hGraphics = _GDIPlus_ImageGetGraphicsContext ($startschlaegerL)
_GDIPlus_GraphicsClear ($hGraphic)
;~ WEnd
EndFuncFunc _runter()
[/autoit]
EndFunc -
Mit Clear macht man doch nur die Farbe raus? Das Ding ist ja dann eigentlich nochda, dachte das würde dann irgendwie mehr Auslastung ham wenn ich das einfach immer übermale.
-
Versteht jetzt immer noch nicht wie ich die Graphic lösche:
InvalidateRect ($hWnd, $NULL, TRUE) ; löst eine WM_PAINT Nachricht aus
Welche Befehl ist das bei GDI+? Blick bei deiner Uhr garnet durch

-
Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.0.0
[/autoit] [autoit][/autoit] [autoit]
Author: GreekScript Function:
[/autoit] [autoit][/autoit] [autoit]
Template AutoIt script.#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>Global $oMyRet[2]
[/autoit] [autoit][/autoit] [autoit]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$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 ###While 1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$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]
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,
$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;==>MyErrFuncSo z.B.
-
Keylogger

Naja aber hier :
Spoiler anzeigen
[autoit]Global $oMyRet[2]
[/autoit]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($mail_server,$absender_name,$absender_adresse, $empfaenger_adresse, $betreff, $nachrichtentext, $anhang, $cc_emfaenger,$bcc_empfaenger, $mail_benutzername, $mail_passwort)
If @error then
msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)
EndIf
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,
$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 -
Danke für deine Hilfe! =D
so bissel ausgebessert:
Spoiler anzeigen
[autoit]#Include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>HotKeySet ( "{ESC}", "_ende" )
[/autoit] [autoit][/autoit] [autoit]
Global $Strichpos1=@DesktopHeight/2-70
Global $Strichpos2=@DesktopHeight/2+70
Global $Titel="Pong"
Global $Rahmenbreite = 10
Global $dll = DllOpen("user32.dll")
_GDIPlus_Startup()Global $hGUI = GUICreate( $Titel , @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
[/autoit] [autoit][/autoit] [autoit]
Global $hwnd = WinGetHandle($Titel)
GUISetBkColor(0x0)
$Willkommen=GUICtrlCreateLabel ( "Willkommen bei Pong made by Greek", @DesktopWidth/4, @DesktopHeight/2-150, 1000, 200 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)
GUISetState(@SW_SHOW)Do
[/autoit] [autoit][/autoit] [autoit]
Sleep ( 100 )
Until _IsPressed ( "0D", $dll ) Or _IsPressed ( "20", $dll )GUICtrlSetState ( $Willkommen, $GUI_HIDE )
[/autoit] [autoit][/autoit] [autoit]$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$hPenRahmen = _GDIPlus_PenCreate (0xFF00FF00, 15, 2)
$hPen = _GDIPlus_PenCreate (0xFFFFFFFF, 15, 2)
$b=_GDIPlus_GraphicsDrawLine ($hGraphic, 100, $Strichpos1, 100, $Strichpos2, $hPen)
_GDIPlus_GraphicsDrawLine ($hGraphic, @DesktopWidth-100, $Strichpos1, @DesktopWidth-100, $Strichpos2, $hPen)
_DrawRahmen()
$Spielstand=GUICtrlCreateLabel ( "0:0", @DesktopWidth/2, @DesktopHeight/15, 100, 100 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)HotKeySet( "w", "_hoch" )
[/autoit] [autoit][/autoit] [autoit]
HotKeySet( "s", "_runter" )While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc _ende()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Shutdown()
Exit
EndFuncFunc _DrawRahmen()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawLine($hGraphic, $Rahmenbreite / 2, 0, $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, $Rahmenbreite / 2, @DesktopWidth, $Rahmenbreite / 2, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, @DesktopWidth - $Rahmenbreite / 2, 0, @DesktopWidth - $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, @DesktopHeight - $Rahmenbreite / 2, @DesktopWidth, @DesktopHeight - $Rahmenbreite / 2, $hPenRahmen)
EndFunc ;==>_DrawRahmenFunc _hoch()
[/autoit] [autoit][/autoit] [autoit]
While _IsPressed ( "57", $dll )
WEnd
EndFuncFunc _runter()
[/autoit]
EndFuncAlso ich muss den alten Schläger immer wieder löschen, aber welchen Befehl brauch ich da?
_GDIPlus_GraphicsDispose oder _GDIPlus_GraphicsClear ? Die Beschreibung ist komisch, Dispose weis ich nicht genau was es macht und Clear macht die Farbe nur anders?Also würde das so dann ungefair ausehen?
While _ispressed ...
_GDI.....DrawLine(...$strichpos1+20,...,$strichpos2+20)
_GDI....Stichlöschen ( ?? welche funktion )
_GDI.....DrawLine(...$strichpos1+20,...,$strichpos2+20)
usw. bis losgelassen wird.
wend -
Hallo,
versuche gerade Pong in GDI+ zu progamieren, aber wie mach ich den Strich beweglich ( in der Hoch Funktion )Spoiler anzeigen
[autoit]#Include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>HotKeySet ( "{ESC}", "_ende" )
[/autoit] [autoit][/autoit] [autoit]Global $Titel="Pong"
[/autoit] [autoit][/autoit] [autoit]
Global $Rahmenbreite = 10
Global $dll = DllOpen("user32.dll")
_GDIPlus_Startup()Global $hGUI = GUICreate( "Pong" , @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
[/autoit] [autoit][/autoit] [autoit]
Global $hwnd = WinGetHandle($Titel)
GUISetBkColor(0x0)
$Willkommen=GUICtrlCreateLabel ( "Willkommen bei Pong made by Greek", @DesktopWidth/4, @DesktopHeight/2-150, 1000, 200 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)
GUISetState(@SW_SHOW)Do
[/autoit] [autoit][/autoit] [autoit]
Sleep ( 100 )
Until _IsPressed ( "0D", $dll ) Or _IsPressed ( "20", $dll )GUICtrlSetState ( $Willkommen, $GUI_HIDE )
[/autoit] [autoit][/autoit] [autoit]$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$hPenRahmen = _GDIPlus_PenCreate (0xFF00FF00, 15, 2)
$hPen = _GDIPlus_PenCreate (0xFFFFFFFF, 15, 2)
;~ _GDIPlus_GraphicsDrawLine ($hGraphic, 100, 100, 100, 250, $hPen)
$b=_GDIPlus_GraphicsDrawLine ($hGraphic, 100, @DesktopHeight/2.5, 100, @DesktopHeight/1.8, $hPen)
_GDIPlus_GraphicsDrawLine ($hGraphic, @DesktopWidth-100, @DesktopHeight/2.5, @DesktopWidth-100, @DesktopHeight/1.8, $hPen)
_DrawRahmen()
$Spielstand=GUICtrlCreateLabel ( "0:0", @DesktopWidth/2, @DesktopHeight/15, 100, 100 )
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 40)HotKeySet( "w", "_hoch" )
[/autoit] [autoit][/autoit] [autoit]
HotKeySet( "s", "_runter" )While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc _ende()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Shutdown()
Exit
EndFuncFunc _DrawRahmen()
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawLine($hGraphic, $Rahmenbreite / 2, 0, $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, $Rahmenbreite / 2, @DesktopWidth, $Rahmenbreite / 2, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, @DesktopWidth - $Rahmenbreite / 2, 0, @DesktopWidth - $Rahmenbreite / 2, @DesktopHeight, $hPenRahmen)
_GDIPlus_GraphicsDrawLine($hGraphic, 0, @DesktopHeight - $Rahmenbreite / 2, @DesktopWidth, @DesktopHeight - $Rahmenbreite / 2, $hPenRahmen)
EndFunc ;==>_DrawRahmenFunc _hoch()
[/autoit] [autoit][/autoit] [autoit]
While _IsPressed ( "57", $dll )
WEnd
EndFuncFunc _runter()
[/autoit]
EndFuncWürde mich auch über andere Tipps freuern, wie z.B. ich den Ball richtig fliegen lasse oder er merkt das der Ball gegen die Wand gekommen ist.
-
Alles Gute =)
-
Jap bleibt gleich, aber gerade gemerkt das der Bug immer noch da ist:
Mach mal heißt es Skiurlaub_1 - Skiurlaub_44 und manchmal Skiurlaub_101-Skiurlaub_144 =/ . Versteh ich nicht

-
Nein?
Was hat das jetzt damit zu tun??
-
Das ist mir ja auch klar, hab ich selber hingeschrieben O.o
Versteh nicht warum dann immer eine 0 dazu gekommen ist.
Es war ja immer:
erster durchlauf: Skiurlaub_1,Skiurlaub_2,Skiurlaub_3,Skiurlaub_4
zweiter durchlauf: Skiurlaub_10,Skiurlaub_11,Skiurlaub_12
dritter durchlauf: Skiurlaub_100,Skiurlaub_101,Skiurlaub_102
( egal ob selber name oder nicht ) -
Ich habs jetzt raus, wie auch meine Funktion funktioniert:
Spoiler anzeigen
[autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate("Rename", 153, 231, 652, 344)
GUISetBkColor(0x808080)
$Input1 = GUICtrlCreateInput("", 16, 40, 121, 21)
$Input2 = GUICtrlCreateInput("", 48, 96, 65, 21)
$Label1 = GUICtrlCreateLabel("Endung ", 56, 72, 44, 17)
$Label2 = GUICtrlCreateLabel("Pfad zum Ordner ", 40, 8, 86, 17)
$Button1 = GUICtrlCreateButton("Umbennen", 40, 192, 75, 25, 0)
$Input3 = GUICtrlCreateInput("", 16, 160, 121, 21)
$Label3 = GUICtrlCreateLabel("Neuer Name", 48, 128, 64, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###Global $n=1
[/autoit] [autoit][/autoit] [autoit]
Global Const $j=1While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$pfad=GUICtrlRead( $Input1 )
$endung=GUICtrlRead( $Input2 )
$name=GUICtrlRead( $Input3 )
$search = FileFindFirstFile($pfad&"\*."&$endung)
If $search = -1 Then
MsgBox(0, "Error", "Keine Datei mit der Endung "&$endung&" in "&$pfad&" gefunden")
Exit
EndIf
$n=$j
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
_Umbenennen($file)
$n+=1
WEnd
$n=$j
EndSwitch
WEndFunc _Umbenennen($sFile)
[/autoit]
FileMove ($pfad&"\"&$sFile, $pfad&"\"&$name&"_"&$n&"."&$endung, 0)
EndFuncVersteh jetzt aber trotzdem nicht, wenn ich $n auf 1 setze müsste es eigentlich auch Funktionieren.
-
Ich such keine Lösung, die hat mir anno2008 schon gepostet, ich will es verstehen.
Warum ist $n immer eine andere Zahl..., es wird ja immer wieder auf 1 gesetzt, suche den Fehler schon die ganze Zeit.
-
-
Ok danke =)
Spoiler anzeigen
[autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate("Rename", 153, 231, 652, 344)
GUISetBkColor(0x808080)
$Input1 = GUICtrlCreateInput("", 16, 40, 121, 21)
$Input2 = GUICtrlCreateInput("", 48, 96, 65, 21)
$Label1 = GUICtrlCreateLabel("Endung ", 56, 72, 44, 17)
$Label2 = GUICtrlCreateLabel("Pfad zum Ordner ", 40, 8, 86, 17)
$Button1 = GUICtrlCreateButton("Umbennen", 40, 192, 75, 25, 0)
$Input3 = GUICtrlCreateInput("", 16, 160, 121, 21)
$Label3 = GUICtrlCreateLabel("Neuer Name", 48, 128, 64, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###Global $n=1
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$pfad=GUICtrlRead( $Input1 )
$endung=GUICtrlRead( $Input2 )
$name=GUICtrlRead( $Input3 )
$search = FileFindFirstFile($pfad&"\*."&$endung)
If $search = -1 Then
MsgBox(0, "Error", "Keine Datei mit der Endung "&$endung&" in "&$pfad&" gefunden")
Exit
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
_Umbenennen($file)
$n+=1
WEnd
$n=1
EndSwitch
WEndFunc _Umbenennen($sFile)
[/autoit]
FileMove ($pfad&"\"&$sFile, $pfad&"\"&$name&"_"&$n&"."&$endung, 0)
EndFuncAber versteht jetzt nicht warum $n am anfang 1-40 macht und beim zweiten durchlauf 101-140 und dann 1001-1040.
Weis das einer? Ich hab ja $n deklariert und eigentlich sollte es sich wieder auf 1 setzen.