#include #include #include Global Const $title = StringTrimRight(@ScriptName, 4) Global $curBrush = 0 Global $redBrush = 0 Global $saveImage = 0 _GDIPlus_Startup() $mainGUI = GUICreate($title, @DesktopWidth, @DesktopHeight, 0, 0, 0x80000000) $mainMenu = GUICtrlCreateContextMenu() $restartMenuItem = GUICtrlCreateMenuItem("Restart", $mainMenu) GUISetState() $_Graphics = _GDIPlus_GraphicsCreateFromHWND($mainGUI) _GDIPlus_GraphicsClear($_Graphics, 0xFFFFFFFF) Global $redPen = _GDIPlus_PenCreate(0xFFFF0000, 2) While 1 Switch GUIGetMsg() Case -3 _exit() Case $GUI_EVENT_MOUSEMOVE _drawRect() Case $GUI_EVENT_PRIMARYDOWN $saveImage = _ScreenCapture_CaptureWnd("", $mainGUI, Default, Default, Default, Default, False) $mouseX = MouseGetPos(0) $mouseY = MouseGetPos(1) $counter = 30 $increase = 20 While 1 $counter += $increase _GDIPlus_GraphicsDrawEllipse($_Graphics, $mouseX-($counter/2), $mouseY-($counter/2), $counter, $counter, $redPen) Sleep(50) If GUIGetMsg() = $GUI_EVENT_PRIMARYUP Then _GDIPlus_GraphicsDrawImageRect($_Graphics, $saveImage, 0, 0, @DesktopWidth, @DesktopHeight) ExitLoop EndIf WEnd EndSwitch WEnd Func _drawRect() Local $amountMin = 1 Local $amountMax = 4 Local $offsetXMin = -20 Local $offsetXMax = 20 Local $offsetYMin = -20 Local $offsetYMax = 20 Local $widthMin = 20 Local $widthMax = 100 Local $heightMin = 20 Local $heightMax = 100 Local $mouseX = MouseGetPos(0) Local $mouseY = MouseGetPos(1) $amount = Random($amountMin, $amountMax, 1) $curBrush = _GDIPlus_BrushCreateSolid(_randomColor()) $offsetX = Random($offsetXMin, $offsetXMax, 1) $offsetY = Random($offsetYMin, $offsetYMax, 1) $width = Random($widthMin, $widthMax, 1) $height = Random($heightMin, $heightMax, 1) For $i = 0 To $amount _GDIPlus_GraphicsFillRect($_Graphics, $mouseX+$offsetX, $mouseY+$offsetY, $width, $height, $curBrush) Next EndFunc Func _randomColor() Local $red, $green, $blue, $color $red = Hex(Random(0, 255, 1), 2) $green = Hex(Random(0, 255, 1), 2) $blue = Hex(Random(0, 255, 1), 2) $color = "0xFF"&$red&$green&$blue Return $color EndFunc Func _exit() _GDIPlus_ImageDispose($saveImage) _GDIPlus_BrushDispose($curBrush) _GDIPlus_PenDispose($redPen) _GDIPlus_GraphicsDispose($_Graphics) _GDIPlus_Shutdown() Exit 1 EndFunc