what is the difference between "dialog box" and "normal window"

and what is a common program window in Windows a "dialog box" or "normal window"
Posted on 2001-10-19 08:26:52 by Mikky
Hi Mikky

A dialogbox is created from a dialogbox resorce.
A "normal window" is created by CreateWindowEx.

You can also create a "normal window" from a dialogbox resorce.

KetilO
Posted on 2001-10-19 08:32:03 by KetilO
there's no difference between the two.

the dialog box is created in a ressource editor, by hand, or by a visual editor, and window will do a dirty job by creating each window, and give the dialog box the #32777 handle, or somethin

the normal window, is created by creatin it with Createwindow()

each the two act like a normal window in the end...
Posted on 2001-10-20 08:50:12 by Sabeel
At a creation point of vue there is no difference. To create some
Dialog you can use 2 ways: Resources Data or Memory Templates
(nothing else than Resources Data saved in the Application Memory).
Example, "CreateDialogParamA" vs "CreateDialogIndirectParamA"
("Indirect" targets Mem Templates).

A third way, "Hand Made" Dialog would be possible too, of course,
because when you ask for a Dialog Creation function, the called function
makes in turn calls to the 'normal' windows creation Functions, but this
would not really be a Dialog (even if looking and runing exactely the
same, because the CallBacks of windows and the CallBacks of Dialog have
not the same behaviour. Test Departement Demos and Tuts often work like
this. (New TD Page is at: < http://www.crahkob.com/td > )

In a true Dialog CallBack:

You just return TRUE (OK, i eat the Message) or FALSE (eat it by yourself).

In a Window CallBack:

The return value is usually FALSE for "OK, i eat it" (the opposite),
but it may vary depending on what Message and what action. When you don't
eat the Message you call for "DefWindowProcA" for "eat it by yourself".


Betov.
Posted on 2001-10-20 11:01:14 by Betov
Don't worry Mikky, no-one laughs at you here. A "dialog box" and a "window" are very similar in Windows but they are created in different ways. A dialog box was originally intended as a simple window that was easy to create to perform simple tasks that did not need a complicated interface.

Typically a "dialog" is drawn in a resource editor which produces a template (an RC file) which is compiled into the EXE file when it is built.

A "window" is usually coded manually when you need more control and a more complex interface. It uses a big structure called a WNDCLASSEX structure that holds the parameters for a registerClassEx() function call and then a CreateWindowEx() function call to create the window with the characteristics set in the WNDCLASS.

The "dialog" engine built into windows make many things simpler to do like tabbing to change focus on different controls and it auto-sizes with different font sizes set in the operating system but if you are building a program like a word processor or text editor or a drawing program or anything where you need extra control over the interface, you code the window manually with CreateWindowEx().

Regards & good luck with your programming.

hutch@pbq.com.au
Posted on 2001-10-20 16:40:35 by hutch--