That's exaclty what I'm trying to do but don't know how through python - get the device context based on a window handle. How do I call the GetDC api through python based on a given window handle? Sorry, this probably should have been my original question.