Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <WinAPI.au3>
- #include <GDIPlus.au3>
- $i = 0
- $title=InputBox("Zeitversetztes Screencapturen","Den Anfang des Fenstertitels eingeben","")
- If @error Then Exit MsgBox(0,"Tja.","Dann halt nicht.")
- $min=InputBox("Zeitversetztes Screencapturen","Wie oft soll gescreencaptured werden? (Alle wieviel Minuten?) Auch Float möglich.","")
- If @error Then Exit MsgBox(0,"Tja.","Dann halt nicht.")
- _GDIPlus_Startup()
- $hWnd = WinGetHandle(WinGetTitle($title))
- If not FileExists(@ScriptDir & "\screenshots\") Then DirCreate(@ScriptDir & "\screenshots")
- While 1
- Sleep(60000*$min)
- $hBMP = _ScreenCapture_CaptureWndEx($hWnd, -1, -1)
- $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP)
- $i += 1
- _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Screenshots\" & $i & ".png")
- _GDIPlus_BitmapDispose($hBitmap)
- _WinAPI_DeleteObject($hBMP)
- WEnd
- _GDIPlus_Shutdown()
- Func _ScreenCapture_CaptureWndEx($hWnd, $iWidth = -1, $iHeight = -1)
- If $iWidth = -1 Then $iWidth = _WinAPI_GetClientWidth($hWnd)
- If $iHeight = -1 Then $iHeight = _WinAPI_GetClientHeight($hWnd)
- Local $hDDC = _WinAPI_GetDC($hWnd)
- Local $hCDC = _WinAPI_CreateCompatibleDC($hDDC)
- Local $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iWidth, $iHeight)
- _WinAPI_SelectObject($hCDC, $hBMP)
- _WinAPI_BitBlt($hCDC, 0, 0, $iWidth, $iHeight, $hDDC, 0, 0, 0x00CC0020)
- _WinAPI_ReleaseDC($hWnd, $hDDC)
- _WinAPI_DeleteDC($hCDC)
- Return $hBMP
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement