2

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!

Keinth Mac
  • 33
  • 3

2 Answers2

1

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

cptiv
  • 167
  • 1
  • 6
  • Yes! Thanks for making me realize that the problem lies within EnumWindows, I created my own method of getting all windows using FindWindowEx and filtered with a specific class name to get the handler I want. – Keinth Mac Jun 19 '19 at 06:09
0

Instead of using EnumWindows, get all windows using this method and insert your filter logic for your desired window handler

            IntPtr thisWindow = IntPtr.Zero ;
            IntPtr desktopWindow = GetDesktopWindow();
            while (true)
            {
            if (desktopWindow == IntPtr.Zero)
            break;

            IntPtr nextWindow = FindWindowEx(desktopWindow, thisWindow, null, null);
            if (nextWindow == IntPtr.Zero)
            break;

            /** your code here **/

            thisWindow = nextWindow;
            }
Keinth Mac
  • 33
  • 3