创建圆角矩形窗口和多边形窗口

bool bRoundRectRgn = false; CRgn rgn; if (bRoundRectRgn) { rgn.CreateRoundRectRgn(0, 0, size.cx, size.cy, 3, 3); } else { int n_size = 3; CPoint points[8]; // left top points[0] = CPoint(0, n_size); points[1] = CPoint(n_size, 0); // right top points[2] = CPoint(size.cx - n_size, 0); points[3] = CPoint(size.cx, n_size); // right bottom points[4] = CPoint(size.cx, size.cy); // left bottom points[5] = CPoint(0, size.cy); rgn.CreatePolygonRgn(points, 6, WINDING); } SetWindowRgn(rgn, TRUE);

你可能感兴趣的:(创建圆角矩形窗口和多边形窗口)