Hi,
I am working on a code in which I am creating a region using CRgn Class,the following is the snippet to create black region on dc:
CRect fpsoverlay;
GetClientRect(&fpsoverlay);
fpsOverlay.right = fpsOverlay.right - 30;
CRgn rgn2;
CBrush bBr2(RGB(0,0,0));
dc.SelectObject(bBr2);
int nOldROP2 = dc.GetROP2();
dc.SetROP2(R2_COPYPEN);
rgn2.CreateRectRgn(fpsoverlay.left,fpsoverlay.bottom-15,fpsoverlay.right,fpsoverlay.bottom);
dc.FillRgn(&rgn2,&bBr2);
SetBkMode(dc,TRANSPARENT);
SetTextColor(dc,RGB(0,255,0));
DrawText(dc,"Caption1",-1,fpsoverlay,DT_CENTER);
I am creating another region next to the first region with different text like the following:
CRect fpsoverlay1;
GetClientRect(&fpsoverlay1);
fpsOverlay1.left = fpsOverlay1.right - 30;
fpsoverlay1.top = fpsoverlay1.bottom-15;
CRgn rgn1;
CBrush bBr3(RGB(0,0,0));
dc.SelectObject(bBr3);
int nOldROP3 = dc.GetROP2();
dc.SetROP2(R2_COPYPEN);
rgn1.CreateRectRgn(fpsoverlay1.left,fpsoverlay1.top,fpsoverlay1.right,fpsoverlay1.bottom);
dc.FillRgn(&rgn1,&bBr3);
SetBkMode(dc,TRANSPARENT);
SetTextColor(dc,RGB(0,255,0));
DrawText(dc,"Caption2",-1,fpsoverlay1,DT_RIGHT);
This code works well in Windows7(it is developed on this OS),but when I use this ActiveX control on windows XP the caption of the second region i.e "Caption2" is not visible.
Please suggest the solution.
Thanks in advance