Advertisement
Guest User

Untitled

a guest
Jun 14th, 2019
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.98 KB | None | 0 0
  1. #RequireAdmin
  2. #include <GUIConstants.au3>
  3. #include <WindowsConstants.au3>
  4. #include <WinAPI.au3>
  5. #include <GDIPlus.au3>
  6. #include <GUICtrlOnHover.au3>
  7. #include <AutoitObject.au3>
  8. #include <Color.au3>
  9. #include <Array.au3>
  10. HotKeySet("{ESC}","E")
  11. Func E()
  12.     Exit
  13. EndFunc
  14.  
  15.  
  16.  
  17.  
  18. Run("notepad.exe")
  19. WinWait("Untitled - Notepad")
  20.  
  21. _GDIPlus_Startup()
  22. $hwnd = WinGetHandle("Untitled - Notepad")
  23. ;~ $hwnd = WinGetHandle("")
  24.  
  25.  
  26. Local $hBitmap = _GDIPlus_BitmapCreateFromScan0(600, 600)
  27. $g_hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
  28. _GDIPlus_BitmapDispose($hBitmap)
  29.  
  30. $g_hDC = _WinAPI_GetDC($hwnd)
  31. $g_hDC_Backbuffer = _WinAPI_CreateCompatibleDC($g_hDC)
  32. $g_oDC_Obj = _WinAPI_SelectObject($g_hDC_Backbuffer, $g_hHBITMAP)
  33.  
  34. $g_hGfxCtxt = _GDIPlus_GraphicsCreateFromHDC($g_hDC_Backbuffer)
  35. _GDIPlus_GraphicsSetSmoothingMode($g_hGfxCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
  36. _GDIPlus_GraphicsSetPixelOffsetMode($g_hGfxCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)
  37. $g_hPen = _GDIPlus_PenCreate(0xff00ff00, 8)
  38.  
  39. Local Const $fDeg = ACos(-1) / 180, $iRadius = 300, $iWidth = 600 / 2, $iHeight = 600 / 2
  40. Local $fAngle = 0
  41.  
  42. While 1
  43.  
  44. ;~  _WinAPI_RedrawWindow($hwnd, 0, 0, $RDW_INVALIDATE + $RDW_FRAME + $RDW_ALLCHILDREN) ; =====> reset cua so, khong can doi voi cua so game
  45.  
  46.     ; ============== draw
  47.     _GDIPlus_GraphicsClear($g_hGfxCtxt, 0xff010101)
  48.     _GDIPlus_GraphicsDrawLine($g_hGfxCtxt, 10, 10, 100, 100)
  49.     _GDIPlus_GraphicsDrawEllipse($g_hGfxCtxt, $iWidth - $iRadius / 2 + $iRadius / 18, $iHeight - $iRadius / 2 + $iRadius / 18, $iRadius - $iRadius / 9, $iRadius - $iRadius / 9, $g_hPen) ;draw ellipse
  50.     _GDIPlus_GraphicsDrawLine($g_hGfxCtxt, $iWidth + Cos($fAngle * $fDeg) * $iRadius, $iHeight + Sin($fAngle * $fDeg) * $iRadius, _ ;draw line
  51.             $iWidth + Cos($fAngle * $fDeg + 180) * $iRadius, $iHeight + Sin($fAngle * $fDeg + 180) * $iRadius, $g_hPen)
  52.  
  53.     $fAngle += 0.1
  54.  
  55.     ;============================
  56.     _winapi_TransparentBlt($g_hDC, 0, 0, 600, 600, $g_hDC_Backbuffer, 0, 0, 600, 600, 0x010101)
  57. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement