[python-win32] Using win32gui.FindWindow() results in black or white screen

Tim Roberts timr at probo.com
Thu Jun 3 12:36:39 EDT 2021


CodingMan125 wrote:
>
>
> Dear, List Members using the FindWindow function from win32gui to find 
> the window handle of a certain window through window name to enable 
> video capture of certain window results in a black screen. Although 
> trying the same code without a window handle to default it to 
> capturing the whole screen results in a successful video capture, the 
> same code however results in a black or white screen when trying to 
> capture a specific window with window handle. How can I solve this?
>
In general, you can't.  From your description and from the comments in 
the code, I'm assuming you're trying to capture some kind of multimedia 
stream -- a movie playback or a camera live view.  In that case, the 
video stream is not actually contained in the application window.  
Instead, the video is rendered in its native format (usually a YUV 
format) into an offscreen region. That offscreen region is then used as 
a texture surface which the GPU's 3D engine renders onto the visible 
screen.  The application window remains a solid color, which is used as 
a chromakey (like a "green screen") to allow menus to be easily drawn on 
top.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3389 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://mail.python.org/pipermail/python-win32/attachments/20210603/68441951/attachment.bin>


More information about the python-win32 mailing list