Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC6 VC7 VC7.1 VC8.0 C++ MFC VC10.0 , +
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,
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 21-Aug-12 23:41pm
Edited 22-Aug-12 0:08am
v3
Comments
Jochen Arndt at 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 at 22-Aug-12 6:21am
   
Thanks for reply first of all.
but it also hide maximize and minimize Button??
Jochen Arndt at 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 at 23-Aug-12 1:50am
   
its complecated !!need alternative??

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 20 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100