be carefull with api functions, they have an suspicious behavior, and you can get various errors on different OS systems. also i can not find the PrintWindow in api.
try to use the VCL, the drawing routines, instead of using API functions.
also provide the errors you encounter.
best regards,