On Apr 28, 2017, at 5:40 PM, Michael C 
<mysecretrobotfact...@gmail.com<mailto:mysecretrobotfact...@gmail.com>> wrote:

I have my own code that samples pixel colour,
https://pastebin.com/4EMd765h

 and now I am trying to add the feature of saving the Device Context to a .bmp 
file, so I found this code

https://books.google.ca/books?id=9MS9BQAAQBAJ

however there is one problem: The book example screenshots the whole desktop 
and I only want a screenshot of a given window. Is there a way to modify the 
black hat example into something that only screenshot a window given its handle?

It would have been easier to help if you had showed us the code you're trying 
to modify.

I assume the code you're copying does GetDC(0) to grab a DC for the desktop.  
If you instead pass the window handle of the window you want to snapshot, just 
pass that to GetDC.  You'll want to use GetWindowRect to find the size of the 
window.
—
Tim Roberts, t...@probo.com<mailto:t...@probo.com>
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to