Problem with Deleting the GDI object
I want to create my own pen and brush, draw an ellipse, and then delete the brush and pen.
The problem is that when I run my program, the font size of my clock in the system tray, and font size of the windows shows in the task bar also changes. Even when I end my program, it still remains the same until I restart my system. Here is a little hint of what I am doing:
Code:
HPEN hpen;
HBRUSH hbrush;
hpen = CreatePen(PS_SOLID, 1, RGB(255,0,0));
hbrush = CreateSolidBrush(RGB(0,255,255));
SelectObject(memhdc, hpen);
SelectObject(memhdc, hbrush);
Ellipse(memhdc, 0,0, 20,20);
DeleteObject(hbrush);
DeleteObject(hpen);
Do you know why it's effecting my whole system?
If you want the full source code then please reply!