GHoSTiewicz Posted October 4, 2023 Posted October 4, 2023 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.
Andreik Posted October 4, 2023 Posted October 4, 2023 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. GHoSTiewicz 1
GHoSTiewicz Posted October 4, 2023 Author Posted October 4, 2023 I turned it off as well, I just forgot to mention it. Interestingly, the problem only occurs with our driver. When I take screenshots of other windows I don't have this problem.
Solution GHoSTiewicz Posted October 4, 2023 Author Solution Posted October 4, 2023 (edited) I have just found the solution. I have changed value from "-60" to "0" for registry key: Computer\HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics Problem fixed. Edited October 4, 2023 by GHoSTiewicz
GHoSTiewicz Posted October 4, 2023 Author Posted October 4, 2023 For some reason the default value of "-60" works correctly on Windows 10 but not on Windows 11. Does anyone know why and could explain it?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now