You are here:

C++/I have 2 questions...



First, Thank You 4 answering my last question. It help me much.

The first question is how to create a GROUPBOX control (Not in a DialogBox). Please give me a source code.

The second question is why when creating a Button using the next code :

HWND hButton;
hButton = CreateWindowEx(NULL, "BUTTON", "Add" ,WS_CHILD | WS_VISIBLE | WS_TABSTOP,
     hwnd, (HMENU) IDC_ADD, GetModuleHandle(NULL), NULL);

The font of the button is big.
When creating a button in a DialogBox the font is ok. How can i create a regular button outside a DialogBox ?


Gil Michael , Thank you for your question.

Windows predefined controls must be created as children of dialog boxes. Otherwise, unexpected results will occur. You can make any window act as a dialog box by following the instructions given in the MSDN Library; specifically, you must allocate space for the local window dialog data and must handle dialog box messages.

You can search Microsoft's MSDN Library at

David Spector


All Answers

Answers by Expert:

Ask Experts


David Spector


Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.


I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2016 All rights reserved.