Search code examples
c#wpfdwm

How to get dwp thumbnail of borderless fullscreen wpf/uwp window


I tried capturing live thumbnail of running applications using these codes: http://community.bartdesmet.net/blogs/bart/archive/2006/10/05/4495.aspx

I have successfully captured some applications except those borderless fullscreen windows.

I am actually trying to capture a UWP application that plays a video in a fullscreen mode and integrate the thumbnail into my application. I don't need to get a bitmap image of it, I just need to display in real-time.

I tried changing the values of

GWL_STYLE WS_VISIBLE WS_BORDER

but none of it works.

When trying to Alt+Tab windows, the Windows 10 DWM can handle it and displays the live thumbnail, so I believe this could work with some little modifications on the code.

Thanks!


Solution

  • I checked the window styles for the example uwp application in full screen with Spy++.

    enter image description here

    Styles were normal so then i hardcoded window handle and it worked. After a moment of debugging, it turned out that the EnumWindows method did not return this window, so it did not matter what styles were checked.

    So I looked for a problem with this method and there are many topics, for example: EnumWindows function in Win10 enumerates only desktop apps