下面是实现程序窗口圆角多角矩形的三种方法,但效果都比较差。只是简单的将边角裁
剪,从边框和标题栏上都可以看出来。不过可以通过这三个函数来学习下
SetWindowRgn()及创建一个HRGN的不同方法。
方法1
void SetWindowEllipseFrame1(HWND hwnd, int nWidthEllipse, int nHeightEllipse){ HRGN hRgn; RECT rect; GetWindowRect(hwnd, &rect); hRgn = CreateRoundRectRgn(0, 0, rect.right - rect.left, rect.bottom - rect.top, nWidthEllipse, nHeightEllipse); SetWindowRgn(hwnd, hRgn, TRUE);}
方法2
void SetWindowEllipseFrame2