Hi,
I created a dialog based applicationFrom dialog properties, i removed Title bar and Set border is none.Then
ProgmaticallyI modified the dialog size using MOveWindow() and i change the dialog shape to a polygon region and applied frame region. its working fine.
But when I created a dialog based application Progmatically, i removed Title bar and Dialog frame as below:
ModifyStyle(WS_CAPTION,0);
ModifyStyle(WS_DLGFRAME,0)
Then ProgmaticallyI modified the dialog size using MOveWindow() and i change the dialog shape to apolygonregion and applied frame region. The frame is not appearing around the dialog. its there only in left and top.
Complete Code:
BOOL CDialogShapeDlg::OnInitDialog(){CDialogEx::OnInitDialog();ModifyStyle(WS_CAPTION,0);ModifyStyle(WS_DLGFRAME,0);CRect rect;GetClientRect(&rect); //Tried with GetWindowRect also but same issueMoveWindow(rect.left,rect.top,400,500);GetClientRect(&rect); //Tried with GetWindowRect also, but same issueCPoint vertex[4];
vertex[0]=CPoint(rect.left,rect.top);
vertex[1]=CPoint(rect.right,rect.top);
vertex[2]=CPoint(rect.right,rect.bottom);
vertex[3]=CPoint(rect.left,rect.bottom);
rgn.CreatePolygonRgn(vertex,4,ALTERNATE);
HGDIOBJ hRgn = rgn.Detach();::SetWindowRgn(GetSafeHwnd(),(HRGN)hRgn, TRUE);
rgn.CreatePolygonRgn(vertex,4,ALTERNATE);return TRUE;}voidCDialogShapeDlg::OnPaint(){CPaintDC dc(this);CBrush*pBrush =newCBrush(RGB(255,0,0));
dc.FrameRgn(&rgn,pBrush,1,1);}
Can anyone please help on this