Jump to content

_ScreenCapture_CaptureWnd in Windows 11


Go to solution Solved by GHoSTiewicz,

Recommended Posts

Hi all,

I am creating a printer driver user interface test. In my test, I take screenshots of all the driver dialogs and compare them to the reference screenshots.
So far, I've done everything on Windows 10 and haven't had any major problems. Now I'm implementing tests on Windows 11.
It turns out that when using the _ScreenCapture_CaptureWnd function, a screenshot is taken with a much larger border. In Windows 10, the border had 1 pixel on each side, in Windows 11 the border has a thickness of  1 pixel for top edge, 6 pixels for left, bottom and right edges.

By border I mean what is captured outside the active window e.g. desktop background or another dialog.

 

As for the comparison itself, I don't have a problem with this because I crop images using openCV. However, for cutting I use hardcoded values. 

I would like to understand why this is happening. Therefore, if anyone understands this problem, please explain.

I turned off window shading but the problem still persists.
I've already dealt with the rounded corners of the dialogs, but I still have this unwanted border.


I'm waiting for your answers. Thank you in advance for them.
 


 

Link to comment
Share on other sites

18 minutes ago, GHoSTiewicz said:

I would like to understand why this is happening. Therefore, if anyone understands this problem, please explain.

I suppose you are talking about Windows Aero that uses transparency effects to customize windows. Try to disable it and check if the problem persist.

When the words fail... music speaks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...