C++ Builder 2009
I have created a round-ish form using CreateRoundRectRgn, which works well, but I am having difficulty drawing a frame around the new shape. The attached code compiles and seems to run fine...except that it doesn't draw the frame. The return code from FrameRgn is non-negative, indicating success. I have tried different types of brushes, different parameters, different canvas handles, and still no frame is being drawn. Frustrating!
In further testing I have also attempted to flood the form using FillRgn, but nothing is drawn even though the return code is also success.
I have spent far too much time on this, and am becoming extremely frustrated! Any and all suggestions are greatly appreciated.
void __fastcall TfrmMain::FormPaint(TObject *Sender)
RECT rect = GetClientRect();
HRGN hRgn = CreateRoundRectRgn(1, 1, rect.right, rect.bottom, 50, 50);
SetWindowRgn (Handle, hRgn, TRUE);
hRgn = CreateRoundRectRgn(0, 1, rect.right, rect.bottom, 50, 50);
FrameRgn(Canvas->Handle, hRgn, GetStockObject(BLACK_BRUSH), 3, 3);