Gogeta70
Gogeta70

Reputation: 901

Custom window frame - Smooth border?

I'm drawing a custom border in my application by handling the WM_NCPAINT message in my message handler. The problem is that even after setting the window region, the corners of my app aren't "smooth".

I thought that maybe i could just get the HDC for the screen and interpolate the pixels around the corners to get a translucency effect, but seeing as i would have to re-draw the border constantly when the user moves the window, i don't think it's a valid option.

Does anyone know of a way to simulate translucency or at least smooth out the border near the corners?

Here's what the corners look like:

http://i.imgur.com/Xaj9k.png

Thanks in advance.

Upvotes: 1

Views: 2660

Answers (1)

arx
arx

Reputation: 16896

Use a Layered Window. This works from Windows 2000 onwards.

If you want Aero Glass effects (Vista onwards) then this article has a nice overview of historical painting techniques and details on using The Desktop Window Manager.

Upvotes: 4

Related Questions