Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Nothing shows on the frame... Using Pen Object

Sonx_hvn7Sonx_hvn7 Member Posts: 54
Hi, is there anything wrong with the code?

The code below is my first attempt of using the Pen tool, no success... Nothing shows on the frame... The brackground of my frame is (0,0,128) RGB...

Anything wrong with this code?

[code]
void DrawWithPen()
{
PAINTSTRUCT pntS;
HPEN pen, oldPen;

hwnd = GetFrameWindow();
hdc = BeginPaint(hwnd, &pntS);
pen = CreatePen(PS_SOLID, 2, RGB(255, 255, 0));
oldPen = (HPEN)SelectObject(hdc, pen);

MoveToEx(hdc, 150, 150, NULL);
LineTo(hdc, 150, 200);


SelectObject(hdc, oldPen);
DeleteObject(pen);
EndPaint(hwnd, &pntS);
}

[B]calls the function...[/B]

DrawWithPen();

[/code]
Sign In or Register to comment.