Hollowyearz

ScreenCap HKS Example

Jan 15th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.53 KB | None | 0 0
  1. #include <ScreenCapture.au3>
  2. HotKeySet("+!d", "_screenCap") ; Shift-Alt-d
  3. HotKeySet("{ESC}", "Terminate")
  4.  
  5. While 1
  6.     Sleep(1000)
  7. WEnd
  8.  
  9. Func _screenCap()
  10.     Local $hWnd = WinGetHandle("[ACTIVE]")
  11.     _ScreenCapture_CaptureWnd(@ScriptDir & "\activeWin.jpg", $hWnd) ;screenshot of active window
  12.     _ScreenCapture_CaptureWnd(@ScriptDir & "\activeWinPart.jpg", $hWnd, 0, 0, 50, 50, True) ;screenshot 50pxX50px top left  active window
  13.     _WinAPI_DeleteObject($hWnd)
  14. EndFunc   ;==>_screenCap
  15.  
  16. Func Terminate()
  17.     Exit
  18. EndFunc   ;==>Terminate
Advertisement
Add Comment
Please, Sign In to add comment