Beiträge von name22
-
-
Freeware: GIMP
Tutorials: Google
-
Entweder ein neues Fenster mit GUICreate erstellen oder vorher erstellen und auf Knopfdruck mit GUISetState sichtbar machen.
-
Da fehlt ja auch ein Dim/Global/Local vor der deklaration des Array.

-
So meinst du?
Spoiler anzeigen
[autoit]#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 192, 124)
$Menu1 = GUICtrlCreateMenu("Menu1")
$MenuItem1 = GUICtrlCreateMenuItem("MenuItem1", $Menu1)
$Menu2 = GUICtrlCreateMenu("Menu1")
$MenuItem2 = GUICtrlCreateMenuItem("MenuItem1", $Menu2)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $MenuItem1
MsgBox(0,"","Item1")
Case $MenuItem2
MsgBox(0,"","Item2")
EndSwitch
WEnd -
Zitat
schon mal danke aber ich würde gerne Ovale Buttons machen
Wo liegt dann das Problem?
Ovale Buttons sind auch möglich, nur funktioniert dann meine _PointIsInCircle Funktion nicht mehr, oder zumindest ist sie nicht mehr genau.
Also müsstest du mithilfe eines imaginären Rechtecks auf Buttonklicks regieren. -
-
Das Anzeigebereich für Webseiten im Mozilla Firefox ist auch ein Control, und ich habe mit dem Window Info Tool das hier gefunden: "[CLASS:MozillaWindowClass; INSTANCE:2]".
[autoit]
Probier mal die ControlID durch das hier zu ersetzen.
Mir fällt da gerade was auf...ControlClick ( "Tickets zur FIFA WM 2010™ inkl. Flug + Übernachtung zu gewinnen - auf CokeFridge! - Mozilla Firefox", "", 11280760 ,>>>> left<<<< , 1 , 823 , 564)
[/autoit]

Edit: 3 Minuten verspätung...

-
-
Und ich habe nur einen: name22.

Wie ich darauf gekommen bin weiß ich bis heute nicht.
-
Zitat
Und ich würde davon gern ein Beispielskript sehen

Wenns denn sein muss.
Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstants.au3>Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]
Opt("MouseCoordMode", 2)$iGUIWidth = 400
[/autoit] [autoit][/autoit] [autoit]
$iGUIHeight = 400
$GUIColorBG = 0xFFFFFFFF$iX_Button1 = 10
[/autoit] [autoit][/autoit] [autoit]
$iY_Button1 = 10
$iWidth_Button1 = 50
$iHeight_Button1 = 50$iX_Button2 = 70
[/autoit] [autoit][/autoit] [autoit]
$iY_Button2 = 10
$iWidth_Button2 = 50
$iHeight_Button2 = 50$sString_Button1 = "1"
[/autoit] [autoit][/autoit] [autoit]
$sString_Button2 = "2"$hWnd = GUICreate("Test", $iGUIWidth, $iGUIHeight)
[/autoit] [autoit][/autoit] [autoit]
GUISetState()_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic)
$hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)
_GDIPlus_GraphicsClear($hGraphic, $GUIColorBG)$hFormat = _GDIPlus_StringFormatCreate()
[/autoit] [autoit][/autoit] [autoit]
$hFamily = _GDIPlus_FontFamilyCreate("Tahoma")
$hFont = _GDIPlus_FontCreate($hFamily, 16)$aInfoString1 = _GDIPlus_GraphicsMeasureString($hBuffer, $sString_Button1, $hFont, _GDIPlus_RectFCreate(), $hFormat)
[/autoit] [autoit][/autoit] [autoit]
$aInfoString2 = _GDIPlus_GraphicsMeasureString($hBuffer, $sString_Button2, $hFont, _GDIPlus_RectFCreate(), $hFormat)$iStringWidth_Button1 = Ceiling(DllStructGetData($aInfoString1[0], "Width"))
[/autoit] [autoit][/autoit] [autoit]
$iStringHeight_Button1 = Ceiling(DllStructGetData($aInfoString1[0], "Height"))
$iStringWidth_Button2 = Ceiling(DllStructGetData($aInfoString2[0], "Width"))
$iStringHeight_Button2 = Ceiling(DllStructGetData($aInfoString2[0], "Height"))$tLayout_Button1 = _GDIPlus_RectFCreate($iX_Button1 + $iWidth_Button1 / 2 - $iStringWidth_Button1 / 2, $iY_Button1 + $iHeight_Button1 / 2 - $iStringHeight_Button1 / 2)
[/autoit] [autoit][/autoit] [autoit]
$tLayout_Button2 = _GDIPlus_RectFCreate($iX_Button2 + $iWidth_Button2 / 2 - $iStringWidth_Button2 / 2, $iY_Button2 + $iHeight_Button2 / 2 - $iStringHeight_Button2 / 2)$hBrush_Button1 = _GDIPlus_LineBrushCreate($iX_Button1, $iY_Button1, $iX_Button1 + $iWidth_Button1, $iY_Button1 + $iHeight_Button1, 0xFF00FF00, 0xFF000000)
[/autoit] [autoit][/autoit] [autoit]
$hBrush_Button2 = _GDIPlus_LineBrushCreate($iX_Button2, $iY_Button2, $iX_Button2 + $iWidth_Button2, $iY_Button2 + $iHeight_Button2, 0xFFFF0000, 0xFF000000)
$hBrushText = _GDIPlus_BrushCreateSolid(0xFF0F0F0F)GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
[/autoit] [autoit][/autoit] [autoit]
GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_PDown")While 1
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsClear($hBuffer, $GUIColorBG)
_GDIPlus_GraphicsFillEllipse($hBuffer, $iX_Button1, $iY_Button1, $iWidth_Button1, $iHeight_Button1, $hBrush_Button1)
_GDIPlus_GraphicsFillEllipse($hBuffer, $iX_Button2, $iY_Button2, $iWidth_Button2, $iHeight_Button2, $hBrush_Button2)
_GDIPlus_GraphicsDrawStringEx($hBuffer, $sString_Button1, $hFont, $tLayout_Button1, $hFormat, $hBrushText)
_GDIPlus_GraphicsDrawStringEx($hBuffer, $sString_Button2, $hFont, $tLayout_Button2, $hFormat, $hBrushText)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)
WEndFunc _PDown()
[/autoit] [autoit][/autoit] [autoit]
$aMousePos = MouseGetPos()
If _PointIsInCircle($aMousePos[0], $aMousePos[1], $iX_Button1 + $iWidth_Button1 / 2, $iY_Button1 + $iHeight_Button1 / 2, $iWidth_Button1 / 2) <> -1 Then MsgBox(64, "Info", "Button 1 wurde geklickt")
If _PointIsInCircle($aMousePos[0], $aMousePos[1], $iX_Button2 + $iWidth_Button2 / 2, $iY_Button2 + $iHeight_Button2 / 2, $iWidth_Button2 / 2) <> -1 Then MsgBox(64, "Info", "Button 2 wurde geklickt")
EndFuncFunc _PointIsInCircle($iX_Point, $iY_Point, $iX_Circle, $iY_Circle, $iRadius_Circle)
[/autoit] [autoit][/autoit] [autoit]
$iDistPoints = _GetPointsDistance($iX_Point, $iY_Point, $iX_Circle, $iY_Circle)
If ($iRadius_Circle > 0 And $iDistPoints < $iRadius_Circle) Or ($iRadius_Circle < 0 And $iDistPoints > $iRadius_Circle) Or $iDistPoints = 0 Then Return $iDistPoints
Return -1
EndFunc ;==>_PointIsInCircleFunc _GetPointsDistance($iPointX1, $iPointY1, $iPointX2, $iPointY2)
[/autoit] [autoit][/autoit] [autoit]
Return Sqrt(($iPointX1 - $iPointX2) ^ 2 + ($iPointY1 - $iPointY2) ^ 2)
EndFunc ;==>_GetPointsDistanceFunc _Exit()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_GraphicsDispose($hBuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_BrushDispose($hBrush_Button1)
_GDIPlus_BrushDispose($hBrush_Button2)
_GDIPlus_BrushDispose($hBrushText)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Exit; #FUNCTION# ====================================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; Name...........: _GDIPlus_LineBrushCreate
; Description ...: Creates a LinearGradientBrush object from a set of boundary points and boundary colors
; Syntax.........: _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2[, $iWrapMode = 0])
; Parameters ....: $nX1 - X coordinate of the starting point of the gradient. The starting boundary line passes through the
; +starting point
; $nY1 - Y coordinate of the starting point of the gradient. The starting boundary line passes through the
; +starting point
; $nX2 - X coordinate of the ending point of the gradient. The ending boundary line passes through the
; +ending point
; $nY2 - Y coordinate of the ending point of the gradient. The ending boundary line passes through the
; +ending point
; $iARGBClr1 - Alpha, Red, Green and Blue components of the starting color of the line
; $iARGBClr2 - Alpha, Red, Green and Blue components of the ending color of the line
; $iWrapMode - Wrap mode that specifies how areas filled with the brush are tiled:
; |0 - Tiling without flipping
; |1 - Tiles are flipped horizontally as you move from one tile to the next in a row
; |2 - Tiles are flipped vertically as you move from one tile to the next in a column
; |3 - Tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column
; |4 - No tiling takes place
; Return values .: Success - Pointer to a new LinearGradientBrush object
; Failure - 0 and either:
; |@error and @extended are set if DllCall failed
; |$GDIP_STATUS contains a non zero value specifying the error code
; Remarks .......: After you are done with the object, call _GDIPlus_BrushDispose to release the object resources
; Related .......: _GDIPlus_BrushDispose
; Link ..........; @@MsdnLink@@ GdipCreateLineBrush
; Example .......; No
; ===============================================================================================================================
Func _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2, $iWrapMode = 0)
Local $tPointF1, $pPointF1
Local $tPointF2, $pPointF2
Local $aResult$tPointF1 = DllStructCreate("float;float")
[/autoit] [autoit][/autoit] [autoit]
$pPointF1 = DllStructGetPtr($tPointF1)
$tPointF2 = DllStructCreate("float;float")
$pPointF2 = DllStructGetPtr($tPointF2)DllStructSetData($tPointF1, 1, $nX1)
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData($tPointF1, 2, $nY1)
DllStructSetData($tPointF2, 1, $nX2)
DllStructSetData($tPointF2, 2, $nY2)$aResult = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", $iARGBClr1, "uint", $iARGBClr2, "int", $iWrapMode, "int*", 0)
[/autoit] [autoit][/autoit] [autoit]If @error Then Return SetError(@error, @extended, 0)
[/autoit]
$GDIP_STATUS = $aResult[0]
Return $aResult[6]
EndFunc ;==>_GDIPlus_LineBrushCreate -
Für dein erstes Script ist das doch echt gut gelungen.

Schau dir doch mal das Beispiel für eine analoge Uhr im AutoIt Ordner unter Examples oder so an. Das ist auch mit GDI+ gemacht.
Jetzt fehlen vielleicht noch Zahlen und Minutenstriche.
-
Das macht man auch mit GDI+ hier mal meine Bildschirmlupe als Beispiel.
Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <ScreenCapture.au3>$iGUIWidth = 100
[/autoit] [autoit][/autoit] [autoit]
$iGUIHeight = 100
$iCaptureWidth = 50
$iCaptureHeight = 50$hWnd = GUICreate("Test", $iGUIWidth, $iGUIHeight, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
[/autoit] [autoit][/autoit] [autoit]
GUISetState()_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic)
$hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)$PosOld = MouseGetPos()
[/autoit] [autoit][/autoit] [autoit]
_ReDraw($PosOld[0], $PosOld[1])HotKeySet("{ESC}", "_Exit")
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
_Exit()
EndSwitch
If Not ($PosOld[0] = MouseGetPos(0) And $PosOld[1] = MouseGetPos(1)) Then
_ReDraw($PosOld[0], $PosOld[1])
$PosOld[0] = MouseGetPos(0)
$PosOld[1] = MouseGetPos(1)
EndIf
WEndFunc _ReDraw($PosX, $PosY)
[/autoit] [autoit][/autoit] [autoit]
WinMove($hWnd, "", $PosX + $iCaptureWidth / 2 + 2, $PosY + $iCaptureHeight / 2 + 2)
$HBITMAP_Capture = _ScreenCapture_Capture("", $PosX - $iCaptureWidth / 2, $PosY - $iCaptureHeight / 2, $PosX + $iCaptureWidth / 2, $PosY + $iCaptureHeight / 2, False)
$hBitmap_Capture = _GDIPlus_BitmapCreateFromHBITMAP($HBITMAP_Capture)
_GDIPlus_GraphicsDrawImageRect($hBuffer, $hBitmap_Capture, 0, 0, $iGUIWidth, $iGUIHeight)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)
_GDIPlus_BitmapDispose($hBitmap_Capture)
_WinAPI_DeleteObject($HBITMAP_Capture)
EndFunc ;==>_ReDrawFunc _Exit()
[/autoit]
AdlibUnRegister()
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_GraphicsDispose($hBuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Exit -
Ich würde ja ein paar schöne Buttons mit Farbverlauf mit GDI+ zeichnen.

-
[autoit]
$Var = _ScreenCapture_Capture()
[/autoit]
[autoit]
Aber danach mit_WinAPI_DeleteObject($Var)
[/autoit]
wieder löschen.;) -
Zitat
P.S. Nein, ich bin kein Botter...
Na dann... Herzlich Willkommen im Forum.
-
Ich find' ihn auch cool.
Ist doch ein prima Beispiel für.. für... naja mir fällt jetzt nichts ein, aber es ist bestimmt zu gebrauchen.
-
So, jetzt muss ich aber auch noch was dazu schreiben.

Ich habe meinen ersten Computer mit 5 bekommen und zwar einen uralten Mac.
Später als ich einen mehr oder weniger funktionsfähigen PC hatte hab ich dann angefangen kleinere Batch Scripts zu schreiben.
Ich kenne AutoIt seit ungefähr einem Jahr, aber ich beschäftige mich erst seit Kurzem intensiv damit.
-
AutoIt installieren oder das Script starten?

-
Du musst auch einen Ordner angeben der unterstützte Musikdateien enthält.
Das kann man auch in der Anleitung lesen!