fgthhhh Posted June 8, 2010 Share Posted June 8, 2010 _ScreenCapture_CaptureWnd can capture a image with coordinate but it don't work with hidden window.i found in forum a way to capture a full hidden window but i don't know how to do it with coordinate( here )can any1 know how to 'Captures a screen shot of a specified HIDDEN window'thx Link to comment Share on other sites More sharing options...
fgthhhh Posted June 8, 2010 Author Share Posted June 8, 2010 UP FOR AN ANSWER Link to comment Share on other sites More sharing options...
JohnOne Posted June 8, 2010 Share Posted June 8, 2010 In order for someone to help you capture co-ords on an area of a hidden window, they would first need to know how you are capturing the full hidden window. Dont be shy, post your code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
fgthhhh Posted June 8, 2010 Author Share Posted June 8, 2010 this is my code. it would capture hidden window but can't do with minimize window i don't know why but sometime it can capture a specific coordinate, sometime it don't work expandcollapse popup#NoTrayIcon #include <GDIPlus.au3> #include <WinAPI.au3> #include <ScreenCapture.au3> _GDIPlus_Startup() $hWnd = WinGetHandle("my bot") $hBMP = _Capture( $hWnd, 100, 100, 200, 200) Func _CaptureWnd( $hWnd, $iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1) Local $tRect = _WinAPI_GetWindowRect($hWnd) $iLeft += DllStructGetData($tRect, "Left") $iTop += DllStructGetData($tRect, "Top") If $iRight = -1 Then $iRight = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left") If $iBottom = -1 Then $iBottom = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top") $iRight += DllStructGetData($tRect, "Left") $iBottom += DllStructGetData($tRect, "Top") If $iLeft > DllStructGetData($tRect, "Right") Then $iLeft = DllStructGetData($tRect, "Left") If $iTop > DllStructGetData($tRect, "Bottom") Then $iTop = DllStructGetData($tRect, "Top") If $iRight > DllStructGetData($tRect, "Right") Then $iRight = DllStructGetData($tRect, "Right") If $iBottom > DllStructGetData($tRect, "Bottom") Then $iBottom = DllStructGetData($tRect, "Bottom") Return _Capture( $hWnd, $iLeft, $iTop, $iRight, $iBottom) EndFunc Func _Capture( $hWnd,$iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1) If $iRight = -1 Then $iRight = _WinAPI_GetSystemMetrics($__SCREENCAPTURECONSTANT_SM_CXSCREEN) If $iBottom = -1 Then $iBottom = _WinAPI_GetSystemMetrics($__SCREENCAPTURECONSTANT_SM_CYSCREEN) If $iRight < $iLeft Then Return SetError(-1, 0, 0) If $iBottom < $iTop Then Return SetError(-2, 0, 0) Local $iW = ($iRight - $iLeft) + 1 Local $iH = ($iBottom - $iTop) + 1 Local $hDDC = _WinAPI_GetDC($hWnd) Local $hCDC = _WinAPI_CreateCompatibleDC($hDDC) Local $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iW, $iH) _WinAPI_SelectObject($hCDC, $hBMP) DllCall("User32.dll", "int", "PrintWindow", "hwnd", $hWnd, "hwnd", $hCDC, "int", 0) _WinAPI_BitBlt($hCDC, 0, 0, $iW, $iH, $hDDC, $iLeft, $iTop, $__SCREENCAPTURECONSTANT_SRCCOPY) _WinAPI_ReleaseDC($hWnd, $hDDC) _WinAPI_DeleteDC($hCDC) _ScreenCapture_SaveImage(@ScriptDir&"\new.jpg", $hBMP, False) _WinAPI_DeleteObject($hBMP) EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now