- Joined
- Jan 25, 2020
- Messages
- 1
- Reaction score
- 0
I think I may have inadvertently changed a registry setting about how WinForms borders are painted. Every UI window that is not custom-painted is square (not rounded on the corners), showing with a thin black border around it, without the blue color and without the left, right and bottom margins. This is only evident when the process is live (in other words, when I capture an image from an active process handle it shows a 'normal' border, but the process UI itself shows the weird border):
(The following information tangents off into Visual Studio, but I have found that the problem is system-wide. Please read on):
I am a VS.NET programmer, and I was looking for a way to capture images of active processes that have user interfaces. I found a thread on CodeProject that was written in 2007 (obviously before Win10) that I thought might help me out. It's called Capturing Minimized Window: A Kid's Trick. I was able to convert the demo (C-Sharp) project for VS 2019, so I ran it and sure enough, it did what I had hoped.
The image above is showing the VS IDE, with the form designer on the left (notice the default 'Sizable' border as designed) while the right side shows the live debugger instance (notice the lack of border) which has captured its own process image (which has the proper border showing). I used this screenshot and scenario not only because it demonstrates my above assertion (that it's only evident when the process is live), but also because I suspect that that same program may have caused my problem (unfortunately, I just noticed this situation today, and I first ran this program a few days ago, so it may be responsible somehow...or maybe not, I don't know). Although I first thought that this might be a Visual Studio settings problem, further investigation showed that it was also happening to system windows and to VS projects that were built long ago and had previously worked properly.
Anyway, the CodeProject article mentioned that in order to get an image for a minimized window it needed to tweek the registry, specifically via API calls to SystemParametersInfo. It also uses the GetWindowLong*, SetWindowLong*, SetLayeredWindowAttributes, ShowWindow and PrintWindow APIs. (*I just realized that I have a 64-bit system, and GetWindowLong and SetWindowLong have been deprecated - could this possibly have caused the problem?)
Unfortunately, I have no system restore point to fall back on. Does anybody have thoughts on how I might correct this situation? I did try rebooting, to no avail...
I am using Windows 10 Home Edition, Version 1903 (OS Build 18362.592), with various .NET frameworks from v2.0 to v4.8, on an x64-based system.
Thank you in advance for any help you can give!
(The following information tangents off into Visual Studio, but I have found that the problem is system-wide. Please read on):
I am a VS.NET programmer, and I was looking for a way to capture images of active processes that have user interfaces. I found a thread on CodeProject that was written in 2007 (obviously before Win10) that I thought might help me out. It's called Capturing Minimized Window: A Kid's Trick. I was able to convert the demo (C-Sharp) project for VS 2019, so I ran it and sure enough, it did what I had hoped.
The image above is showing the VS IDE, with the form designer on the left (notice the default 'Sizable' border as designed) while the right side shows the live debugger instance (notice the lack of border) which has captured its own process image (which has the proper border showing). I used this screenshot and scenario not only because it demonstrates my above assertion (that it's only evident when the process is live), but also because I suspect that that same program may have caused my problem (unfortunately, I just noticed this situation today, and I first ran this program a few days ago, so it may be responsible somehow...or maybe not, I don't know). Although I first thought that this might be a Visual Studio settings problem, further investigation showed that it was also happening to system windows and to VS projects that were built long ago and had previously worked properly.
Anyway, the CodeProject article mentioned that in order to get an image for a minimized window it needed to tweek the registry, specifically via API calls to SystemParametersInfo. It also uses the GetWindowLong*, SetWindowLong*, SetLayeredWindowAttributes, ShowWindow and PrintWindow APIs. (*I just realized that I have a 64-bit system, and GetWindowLong and SetWindowLong have been deprecated - could this possibly have caused the problem?)
Unfortunately, I have no system restore point to fall back on. Does anybody have thoughts on how I might correct this situation? I did try rebooting, to no avail...
I am using Windows 10 Home Edition, Version 1903 (OS Build 18362.592), with various .NET frameworks from v2.0 to v4.8, on an x64-based system.
Thank you in advance for any help you can give!
Last edited: