• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4046
  • Last Modified:

Minimize Icon, Maximize icon?

How do I change the graphics of the maximize and minimize icon?(the one on the top right hand corner)
0
RodneyYeo
Asked:
RodneyYeo
  • 5
  • 2
1 Solution
 
MichaelSCommented:
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);
}
0
 
RodneyYeoAuthor Commented:
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?
0
 
RodneyYeoAuthor Commented:
Adjusted points to 30
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
luisrCommented:
It is not easy... for painting your own title bar see the code published by Paul DiLascia in the June 1997 issue of MSJ. To make other buttons respond you would need to trap WM_NCLBUTTONDOWN and UP messages and hit test for your buttons.

You can download the code from http://www.microsoft.com/msj/.
0
 
RodneyYeoAuthor Commented:
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.
0
 
RodneyYeoAuthor Commented:
Adjusted points to 50
0
 
luisrCommented:
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).
0
 
RodneyYeoAuthor Commented:
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now