Rounded Corners in Win32 Windows

To make corners rounded, simply call SetWindowRgn API. Easiest is to respond to WM_SIZE message like this:

 1case WM_SIZE:
 2    //rounded corners!
 3    {
 4        RECT wRect;
 5        if(::GetWindowRect(hWnd, &wRect)) {
 6            HRGN hRgn = ::CreateRoundRectRgn(wRect.left, wRect.top, wRect.right, wRect.bottom, 30, 30);
 7            ::SetWindowRgn(hWnd, hRgn, TRUE);
 8            ::DeleteObject(hRgn);
 9        }
10    }

Result:

image-20221213135643075

P.S. Browser Tamer is a browser automation system utility done in spare time by myself. Official page is located here.

Have feedback or questions? Feel free to email me.