Earn without any Investment!

Monday, February 21, 2011

VC++ MFC Program To display Shapes

#include
class myframe : public CFrameWnd
{
public:
myframe()
{
Create(0,L"Shape");
}
void OnPaint()
{
CPaintDC d(this);
CBrush mybrush(RGB(0,0,150));
d.SelectObject(&mybrush);
d.MoveTo(10,10);
d.LineTo(200,10);
d.Rectangle(10,20,200,100);
d.RoundRect(10,120,200,220,20,20);
d.Ellipse(10,240,200,340);
d.Pie(250,10,350,110,350,110,350,10);
POINT pt[5]={250,150,250,300,300,350,400,300,320,190};
d.Polygon(pt,5);
}
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(myframe,CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
class myapp : public CWinApp
{
public:
int InitInstance()
{
myframe *p;
p=new myframe;
p->ShowWindow(3);
m_pMainWnd=p;
return 1;
}
};
myapp a;

1 comment:

  1. If you're trying to burn fat then you certainly have to start using this totally brand new custom keto meal plan.

    To create this keto diet service, certified nutritionists, personal trainers, and top chefs united to produce keto meal plans that are productive, convenient, economically-efficient, and satisfying.

    Since their first launch in January 2019, 100's of people have already transformed their figure and well-being with the benefits a great keto meal plan can offer.

    Speaking of benefits: clicking this link, you'll discover eight scientifically-confirmed ones offered by the keto meal plan.

    ReplyDelete