that was the same problem i am going though.
I have seen some modal dialogboxes which have the X button and not have the icon.
wonder if i need to write some code to override some method.
Main Topics
Browse All TopicsHi all.
I have a modeless dialogbox which has a minimize, maximize, cancel button. It also display's the Icon on the top left hand side corner and the window can be resized by selcting the bottom right handside corner and dragging the box.
I was to retain the Cancel button and the ability to resize the dialog box by selecting the bottom right hand corner with the mouse and draging it.
i am using VC++ .NET and these properties can be set from the property table, but for some reason, i cannot obtain the exact configuration that i have mentioned above.
Any Ideas
Thanks...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
A check with Spy++ shows that the icon in the title bar is not a separate window, which means you can't hide it or anything.
The only thing I can think to do would be to owner-draw the title bar. then you can just display the title and the [X]. You will have to handle the mouse-click and figure out if it is on the [X] and take appropriate action yourself.
Or you could create a new icon with nothing in it; it will appear as if it isn't there, although if the user clicks there they will see the menu.
Those things on the property page map directly to the resource in the .rc file. For example, my resource has this line in it:
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE |
WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
You can override the PreCreateWindow() function if you want to programatically mess around with the styles, see the MSDN for an example. I'm not sure this will get you anywhere though, because the display of the [X] button seems to be tied to the existence of the "Close" entry on the system menu - no menu means no Close entry, no close entry means no [X].
I think ownerdraw may be your best hope.
To change the minimize/maximize/etc button properties in your app, add the following in you OnInitDialog function:
// Dialog with minimize box and system menu.
ModifyStyle(0,WS_MINIMIZEB
// To add the items to your apps context menu (right click on apps taskbar icon) you need to do the following:
GetSystemMenu(FALSE)->Inse
GetSystemMenu(FALSE)->Inse
GetSystemMenu(FALSE)->Inse
Hope that helps.
>>what i want is the Icon on the left handside to dissapear but retain the X on the right hand side
I think you need you dialogbox as 'tool window' for that you need to set Extended style as WS_EX_TOOLWINDOW
You may use 'ModifyStyleEx' to set extended style...
ModifyStyle(WS_MINIMIZEBOX
ModifyStyleEx(0,WS_EX_TOOL
ie. remove max, min buttons, set WS_SYSMENU as is and add WS_EX_TOOLWINDOW
-MAHESH
Business Accounts
Answer for Membership
by: waysidePosted on 2006-10-11 at 12:35:48ID: 17709977
Border=Resizing
MaximizeBox=False
MinimizeBox=False
Style=Popup
SystemMenu=True
TitleBar=True
I don't know of a way to show the X button and not have the icon, they both seem to be controlled by the SystemMenu property.