Click here to Skip to main content
15,881,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi All,
Every mfc application created with two default icons,
1)MFC icon :- for main window.
2)Doc icon :- for child window.

I replaced main window icon with help of givn article,
Replacing the Default MFC Icon[^]

But problem arised when i deal with child frame icon.
I can replace child window icon with help of SetIcon() a mfc function.
but i want remove the icon from child window and not replace.
i tried,
CSS
SetIcon(NULL,TRUE);
SetIcon(NULL,FALSE);

In ::OnCreate of Child frame but its not working.instead of removing icon it displays a blank icon.

I also tried to remove ..

&=~WS_SYMENU

but removes maximize , minimize and close button also.
Please help me ,
to remove the child frame icon from title of child frame.
little hint of you guys worth me lot.

Thanks,
Santosh dhanawade.
Posted
Updated 21-Aug-12 23:08pm
v3
Comments
Jochen Arndt 22-Aug-12 6:08am    
There is no simple solution for your problem. The display of the close button is tied to the system menu style. There are window styles that allow creation of windows without the system menu icon (WS_EX_DLGMODALFRAME, WS_EX_TOOLWINDOW). But these styles are not for frame windows.
Coder Block 22-Aug-12 6:21am    
Thanks for reply first of all.
but it also hide maximize and minimize Button??
Jochen Arndt 22-Aug-12 7:10am    
Hint: Use the Reply button right of a comment. Then the author of the comment gets a mail notification upon replying.

Yes, because they are also system menu commands. The corresponding style flags are provided to disable these buttons with system menus.

You should think about the idea to remove the icon while supporting the system menu commands:
- The icon is the mouse button to open the system menu
- It indicates that there is a system menu that can be also activated with Alt+
- It is helpful when identifying minimized windows (especially when using user defined icons)

It is a general Windows GUI element. Removing such elements or changing the behaviour should be always avoided.
Coder Block 23-Aug-12 1:50am    
its complecated !!need alternative??

1 solution

Then you must override the drawing of the non-client area yourself, and perhaps even handle the mous clicking and window dragging as well. That area above the client area where the title bar is drawn is called the non-client area, and some legacy articles here or on CodeGuru might explain how to do that drawing. Yes, it IS complicated. Like Jochen said, you should seriously consider why you want or need to do this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900