SetWindowRgn() を使用して形状を roundrect に変更したモードレス ダイアログがあります。FrameRgn を使用して、その周りに色付きの境界線を描画したいと思います。これが私が使用しているコードです
BOOL CMyDlg::OnInitDialog() 
 {
 CDialog::OnInitDialog(); m_Brush.CreateSolidBrush(RGB(255,255,255));
 CRect rcDialog;
 GetClientRect(rcDialog);
 // This Creates area assigned to Dialog: This goes directly below the above in OnInitDialog
 m_rgnShape.CreateRoundRectRgn(rcDialog.TopLeft().x, rcDialog.TopLeft().y,rcDialog.BottomRight().x,rcDialog.BottomRight().y, rcDialog.Width()/8, rcDialog.Height()/8);
::SetWindowRgn(GetSafeHwnd(), (HRGN)m_rgnShape, TRUE);
return TRUE; // return TRUE unless you set the focus to a control
  // EXCEPTION: OCX Property Pages should return FALSE
}
void CMyDlg::OnPaint() 
{
 CPaintDC dc(this); // device context for painting
 CBrush brush;
 brush.CreateSolidBrush(RGB(255,0,0));
  dc.FrameRgn(&m_rgnShape, &brush, 2, 2);
}
FrameRgn が機能しない理由を誰かが説明できますか。それを機能させるサンプル コードをここに提供してください。