Put this before you #include <Windows.h>:
Code:#define _WIN32_WINNT 0x0500
Put this before you #include <Windows.h>:
Code:#define _WIN32_WINNT 0x0500
I get no link errors or warnings anymore, but then the color is not changed, always defaults to black... Is there any other form one can change line color when drawing? Here's my code
Code:// Select the new pen and its color. // Draw the arc using API arc function hPen = (HPEN)GetStockObject(BLACK_PEN); hOldPen=(HPEN)SelectObject(hdc, hPen); SetDCPenColor(hdc,RGB(R,G,B)); Arc( hdc, left, top, right, bottom, xstart, ystart, xend, yend ); SelectObject(hdc, hOldPen);
I am not sure you can modify a Stock GDI object. YOu would change the default Pen, not select in a Stock Pen and then change the colour.
I use CreatePen() as it give me more control.
Code:hPen=(HPEN)CreatePen(PS_SOLID,1,RGB(R,G,B));//solid pen one px wide hOrigPen=SelectObject(hDC,hPen); //draw SelectObject(hDC,hOrigPen); DeleteObject(hPen);
Last edited by novacain; 06-18-2008 at 11:49 PM. Reason: clarity
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill