You are here:

C++/Add a minimize button to my dialog box


Hi Ralph,

I'd like to add a minimize button to the title bar of my dialog box program. I've looked through MSDN and all my books but there isn't any mention of it.
I am using MSC++6 which is part of Visual Studio 6.

Thanks in advance for helping me with my problem,

This is not a C++ programming issue per say. It is a MS Windows programming question.

The reason you may be having problems is that the minimise box is part of the frame of a window - sometimes called 'chrome'; in MS Windows such parts of a window are known as non-client areas - hence the set of messages with NC in their name.

So whether you get a minimise box or not depends on what window styles you specified when creating the window. For many simple dialogs - message boxes, login requests etc, you will not require such things as title bars, minimise boxes, etc. For others they will tend towards being fully blown windows than simple dialog windows - in which case are you going about this in the best way?

If you are loading the dialog from a resource as specified in a resource file (.rc file) then check out the STYLE and EXSTYLE statements to a DIALOG/DIALOGEX definition. For the raw resource file information start at (correct at time of writing), from which you can link through to the STYLE and EXSTYLE pages. Once you have this information check out setting such things in the resource manager if you are using it.

Ultimately the window style available are used by the CreateWindow and CreateWindowEx Win32 API functions. The window styles are described at and the extended styles at under the description for the dwExStyle parameter. I add these links as the link from the MSDN online resource file pages did not work for me!

You will note that one of the window styles you can select is WS_MINIMIZEBOX, described as:

       "Creates a window that has a minimize button.
        Cannot be combined with the WS_EX_CONTEXTHELP style.
        The WS_SYSMENU style must also be specified."

Note that window styles can also be set for a whole window class in the WNDCLASS / WNDCLASSEX structures passed to RegisterClass/RegisterClassEx Win32 API functions. However if you are using the MFC then it is unlikely you will need to get involved at this level of detail.

If you do not understand any of the above then I suggest you start reading up on the basics of MS Windows programming and then tackle the way to do it using the MFC or ATL libraries or whatever you are using. Believe it or not there is quite a lot of introductory material in the MSDN library. You might like to start at with emphasis on windowing ( Each section has an overview section. The main problem is putting it all together in some sort of useful order! Which is why people might prefer to use a good book on MS Windows programming such as the classic "Programming Windows" by Charles Petzold (

Hope this gives you some pointers.  


All Answers

Answers by Expert:

Ask Experts


Ralph McArdell


I am a software developer with more than 15 years C++ experience and over 25 years experience developing a wide variety of applications for Windows NT/2000/XP, UNIX, Linux and other platforms. I can help with basic to advanced C++, C (although I do not write just-C much if at all these days so maybe ask in the C section about purely C matters), software development and many platform specific and system development problems.


My career started in the mid 1980s working as a batch process operator for the now defunct Inner London Education Authority, working on Prime mini computers. I then moved into the role of Programmer / Analyst, also on the Primes, then into technical support and finally into the micro computing section, using a variety of 16 and 8 bit machines. Following the demise of the ILEA I worked for a small company, now gone, called Hodos. I worked on a part task train simulator using C and the Intel DVI (Digital Video Interactive) - the hardware based predecessor to Indeo. Other projects included a CGI based train simulator (different goals to the first), and various other projects in C and Visual Basic (er, version 1 that is). When Hodos went into receivership I went freelance and finally managed to start working in C++. I initially had contracts working on train simulators (surprise) and multimedia - I worked on many of the Dorling Kindersley CD-ROM titles and wrote the screensaver games for the Wallace and Gromit Cracking Animator CD. My more recent contracts have been more traditionally IT based, working predominately in C++ on MS Windows NT, 2000. XP, Linux and UN*X. These projects have had wide ranging additional skill sets including system analysis and design, databases and SQL in various guises, C#, client server and remoting, cross porting applications between platforms and various client development processes. I have an interest in the development of the C++ core language and libraries and try to keep up with at least some of the papers on the ISO C++ Standard Committee site at


©2017 All rights reserved.

[an error occurred while processing this directive]