tags:

views:

392

answers:

3

I need to understand the differences between windows main/mdi/child/dialogs.... how win32 messages should be propagated... why some messages are present in one type and not other...

A: 

Im not a windows developer, but heres what I understand:

main window - toplevel container which you can active/see in the taskbar.

dialog - little box locking (if modal) your window, not seeable in the taskbar. Mostly used to display message to the user.

mdi (Multiple Document Interface) - Not directly a window but more a simple container for storing child windows. Each child window can be maximized/minimized/closed inside this container, but you wont find any of these in the taskbar. http://en.wikipedia.org/wiki/Multiple_document_interface

ZeissS
+3  A: 

There is reference information available here on the MSDN website. If you want more of an introduction or tutorial, then Charles Petzold's book Programming Windows is excellent.

ChrisN
+1  A: 

Main window The application's top window. It's flaged as the process main window and this information can be easily accessed by calling processes with the appropriate permission.

MDI (Multiple document interface) window This is, typically, in an application main window and it contains a set of MDI Children. This is mostly a window class integrated with Win32 API. I beleive it's not treated differently by the operating system as any other window class. Those are becoming extinct in favor of multiple SDI windows (Word 2007).

Child This is a child window of any other window. Its position, visibility and mostly everything is dependent on the parent window. The children send notifications to their parents. A notification is a specific kind of window message.

Dialog Dialogs provides easy child creation and input handling based on what 95% of dialogs need. Dialog functions in the API let you create a window and it's children using compiled templates in the PE file (.exe). The message handling is also slightly different since you are working mostly with notifications from children.

The main difference with dialogs is when you are using a modal one. The creation call will block until the user closes the dialog. This can make UI updating a little tricky in some situations.

Coincoin