Nothing shows on the frame... Using Pen Object

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?

void DrawWithPen()
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);
EndPaint(hwnd, &pntS);

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


Sign In or Register to comment.

Howdy, Stranger!

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