Hi !

I was wondering where the difference is between CreateDialogParam and DialogBoxParam.

Well, I have read the tutorial, but when I investigate
the examples tut10-1 and tut10--2 it seems that I
can jump arond with the INPUT FOCUS, and I can't
see any difference ?

Maybe I didn't understand exactly what Iczelion
meant by changing the INPUT FOCUS.......:)
Posted on 2002-05-13 06:47:33 by The SharK
As far as I remember...

DialogBoxParam: creates a modal dialog box (ie, if you pass
a valid parent hwnd, you can not return to the parent window before
the dialog box is done). Return value is a dword, in fact the dword
passed in the EndDialog call.

CreateDialogParam: creates a modeless dialog box, and
returns the HWND of this dialog box.

I could be wrong, better check the PlatformSDK :).
Posted on 2002-05-13 07:04:36 by f0dder
yeah, you are correct f0dder.
CreateDialog create a modaless dialog box, while DialogBox create a modal dialog box.
Posted on 2002-05-13 07:40:49 by roticv
Another difference is that the modal dialog is created by an internal message loop. The internal loop will take precedence over any message loops you code. Some applications take advantage of this by using a modal dialog box as the main window. That way, you can delete the message loop from your code.

The nonmodal (or modeless) dialog requires you to have an explicit loop or it won't work at all.

Regarding input focus:

If you're talking about keyboard navigation -- with a nonmodal dialog, you use IsDialogMessage to get keyboard navigation. A modal dialog internally calls IsDialogMessage, so the navigation is always there.
Posted on 2002-05-13 16:03:39 by tenkey
Hi again !

If I understood Iczelion's tutorial correct, the point
of tut-01 and tut-02 was to see the difference between
the modeless dialog box (which you CAN CHANGE INPUT
FOCUS in the same or another application), and the
application modal dialog box, which you CAN'T change
the INPUT FOCUS in the SAME application.

When I try to see this in practice (from the two files
in his tut's, I can't make it work ?
I can change the INPUT FOCUS as I like with BOTH
FILES ???

A little confusing, but I think I get the point anyway.....

;)
Posted on 2002-05-13 16:18:16 by The SharK
When you call DialogBoxParam, you specify an owner window. What you can't do is switch input focus between the modal dialog and the owner window. You must close the modal dialog to put the input focus back in the owner window.

With CreateDialogParam, you also specify an owner window. But in this case, you can switch input focus between the dialog and the owner window. You don't need to close the dialog to accomplish this.
Posted on 2002-05-14 01:04:57 by tenkey
Hi tenkey !

That's correct, and that's exactly what I meant.
But I think that there maybe and error in my
two files, since they don't have any difference.
I can switch INPUT FOCUS in both files as if
they both where MODELESS DIALOG BOX'ES.

But what the heck....it doesn't really matter,
as long as one gets the point of the tutorials.

I think that Iczelion's Tutorials 1-35 is the
BEST on the Internet !!!!!!!!!!!!!!!!!!!!!!!!!


Thanks:alright:
Posted on 2002-05-14 10:01:09 by The SharK
Iczelion's Tutorial is good. Do you guys know how to create the kind of toolbar like that of winword or vc++ whereby you can move the toolbars? I'm interested to know how to create such a thing. Thanks.
Posted on 2002-05-14 11:30:52 by roticv
The way I get it, and the way it works on my system. is with a
modal window the TAB key navigates (changes the focus) only
between mother and child windows first, then between unrelated
ones. With the mouse, you can put the focus wherever you want.
....(I think....)
Posted on 2002-05-15 10:02:24 by Bighillwill
Yes, but in a MODAL DIALOG BOX, you can't (if it works
correct) change the input focus from the child to the
parent window, only in a modeless dialog box you can
switch between the child and the parent window.
Posted on 2002-05-16 06:24:31 by The SharK
what message is sended: WM_INITDIALOG or WM_CREATE
to the window's procedure?
I saw that if I make ,after have Register the DialogBox like a CLASS,:
invoke CreateDialogParam,hInst,addr DlgName,NULL,NULL,NULL
we got WM_CREATE
and if we make:
invoke CreateDialogParam,hInst,addr DlgName,NULL,addr WndProc,NULL
we got WM_INITDIALOG

isn't?
Posted on 2002-05-17 14:32:54 by franlou
Hi franlou

Actually I don't really know, I'm new to Win32Asm, but you
can use spy from the SDK to examine this topic !

Is it WINDOWS who sends these messages
(WM_INITDIALOG / WM_CREATE), when you use
INVOKE to call some API function ?:)
Posted on 2002-05-18 03:34:28 by The SharK