News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

When to use dialog box?

Started by benji, May 26, 2008, 05:23:37 AM

Previous topic - Next topic

benji

Hai,...

When should i use dialog box?
Right now i'm reading iczellion's tutorial, chapter 11.

If i'm making an application in VB6, i just drag and drop the edit control (edit text, button, etc).
And in assembly we're dealing with dialog box and edit control.
So, if i'm making a form with edit text, button, etc in assembly just like normal VB6 app, should i use dialog box or just create it in the window (without dialog box)?
If i must use dialog box, how do i "paste" it in the window (make it as one body with the window)?
Because iczellion use the dialog box as a "pop up" and in the previous tutorial he just make the edit control in the window without using the dialog box.

Thanks,
Febry

hutch--

Febry,

The easiest way to create the dialog template is with a dialog editor. It creates an RC file that you compile into a RES file that can be linked directly into an executable.

If you want the simpler method have a look at RadAsm as it has this type of support. I think EasyCode also has support for drag and drop controls onto a form.

This much I would advise you, to learn this style of programming, being able to do it manually with code and a resource editor will give you a much better understanding of how it all works.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

benji

Hai Mr. Hutch,

Thanks for your answer, but i don't want to use IDE or any any drag & drop i want to do it manualy.
So i can understand how the "core" works.

What i want ask you now is that, if i want to make a window that has edit boxes and buttons should i put it (edit boxes and buttons) in dialog box or not? If yes, is it the same with make the dialog box as main window?
or what i have to do ?

As much as i can understand from Iczellion's tutorial, i can use dialog box as :
1. main window
2. I/O tool
But, can i  make make a dialog box with edit boxes and buttons, and then put that dialog box in the window (lying at the window as part of that window)?

And in Iczellion's tutorial (chapter 11), he didn't put (or "paste") the dialog box to the window, he just use it as a pop up. So it's kind of seperated between the dialog box and main window, can i "paste" the dialog box to the window?

Thanks,
Febry

MichaelW

Do you understand that a dialog box is a window? Dialog boxes differ from an application window mainly in that they are (normally) based on a system-defined class, and created by the system. A further difference for modal dialogs, and one that makes them particularly easy to code is that the system provides the message loop. I'm sure that you could use a dialog box as the child of an application window, but at least for anything normal I cannot see any good reason to do this. There would be major problems trying to do this with a modal dialog, because the function that creates the dialog does not return until the dialog is destroyed. And to do this with a modeless dialog would require some more or less complex code, because the main window and the dialog would both need a functional message loop and window procedure. And as you describe it the dialog box would be the parent of the controls, so the control messages would be directed to the dialog box window procedure, and the window procedure for the main window would have very little to do. Dialog boxes can readily be used as the main window of an application, and from the user's perspective they are typically indistinguishable from a normal application window.
eschew obfuscation