View Single Post
Light Poster
21Jan2010,19:04  
palz's Avatar
i have tied to a rectangle in caption bar of window but this doesn't work .am i doing any mistake.plz correct me .

Code: MFC
void CMainWnd::OnNcPaint( )
{
    CDC dc = (CDC)GetWindowDC();
    RECT rectMine = {30,3,100,20};
    FillRect(dc, &rectMine, (HBRUSH)GetStockObject(DKGRAY_BRUSH));
    SetBkMode(dc, TRANSPARENT);
SetTextColor(dc, RGB(255, 0,0));
   DrawText(dc, "My Dialog", strlen("My Dialog"), &rectMine, 0);
  ReleaseDC(dc);
}