Link to home
Start Free TrialLog in
Avatar of RodneyYeo
RodneyYeo

asked on

Minimize Icon, Maximize icon?

How do I change the graphics of the maximize and minimize icon?(the one on the top right hand corner)
Avatar of MichaelS
MichaelS

Not easy one. You have to drow it by your own in the WM_NCPAINT message.

case WM_NCPAINT:
{   HDC hdc;
    hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);
    // Paint your pictures
    ReleaseDC(hwnd, hdc);
}
Avatar of RodneyYeo

ASKER

say, i manage to draw over the current icons, will that particular spot respond to my mouse click?
let say I shift my minimize and maximize icons to the centre of the title bar, how do i handle the message of the mouse click?
Adjusted points to 30
ASKER CERTIFIED SOLUTION
Avatar of Luis Alonso Ramos
Luis Alonso Ramos
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have add 3 window messages into my mainframe, OnNcPaint(), OnNcActivate(), OnNcLButtonDown().
SOme of codes in my OnNcLButtonDown()
{
CRect rect;
// Get the button position
GetButtonRect(&rect);
if (rect.PtInRect(point))
{
drawButton();
CFrameWnd::OnNcLButtonDown();
....
}
....
}

It seems that the CFrameWnd::OnNCLButtonDown will override my graphic display of my drawButton(). How do I turn off the graphical display of the minimize, maximize and close button. THanks.
Adjusted points to 50
When dealing with the titlebar, it's either all or nothing. If you want to do something, you have to handle everything, and not pass anything to the base class (or ::DefWindowProc).
Thanks for the advice. I guess there's no easy way out. I will study the codes that you have provided and paint my own title bar.