Cathie & Arnaud wrote:
Hi !
I'm a Java developper and I wish to make a capture of an offscreen window (on WinXP). It's not possible in Java, so I use a python script and WM_PRINT, but it doesn't seem to work.
Could someone have a look at my script and give me any advise ? (That's my first script in python, be kind !)
TIA
import win32api, win32con, sys
# sys.argv[0] is script name hwnd = int(sys.argv[1]) hdc = int(sys.argv[2])
win32api.SendMessage(hwnd, win32con.WM_PAINT, hdc, 0)
win32api.SendMessage(hwnd, win32con.WM_PRINT, hdc, win32con.PRF_CHILDREN | win32con.PRF_CLIENT | win32con.PRF_OWNED)
check that hdc is valid DC handle.
HTH Niki Spahiev _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32