Rounded Corners in Win32 Windows

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

case WM_SIZE:
    //rounded corners!
    {
        RECT wRect;
        if(::GetWindowRect(hWnd, &wRect)) {
            HRGN hRgn = ::CreateRoundRectRgn(wRect.left, wRect.top, wRect.right, wRect.bottom, 30, 30);
            ::SetWindowRgn(hWnd, hRgn, TRUE);
            ::DeleteObject(hRgn);
        }
    }

Result:

image-20221213135643075

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


To contact me, send an email anytime or leave a comment below.