flat assembler
Message board for the users of flat assembler.

Index > Windows > CreateWindowEx vs CreateDialogParam: what is better

Author
Thread Post new topic Reply to topic
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix 24 Dec 2004, 12:05
Hello,everybody!

What is better to use: a lot of CreateWindowEx calls to create window controls or CreateDialogParam with linked dialog resource? I suppose (i have tried both) that use of CreateDialogParam result in smaller EXE size, but what about message processing speed and all conserned (i mean dialogs and windows created manually)?

Thanks.

_________________
Flat Assembler is the best!
Post 24 Dec 2004, 12:05
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 24 Dec 2004, 13:09
Well, dialog resources are too simple for some tasks. For example they can't contains child windows that have its own childs i.e. you can't create multi-level windows using dialog templates.
OTOH, dialog templates needs less memory and generaly make you program smaller.

Though, there is one more way: Fresh standard library have set of template based features for advanced creating windows systems. You can create windows fully in visual way (or in source using macroses) and create instances of these forms in runtime, simply calling a procedure.
It is hard to describe whole library here (someday, someone have to write a manual Wink ) but you simply can experiment a little with latest Fresh (File|New application|Win32 SDI tiny application) that will give you working example.

Regards
Post 24 Dec 2004, 13:09
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 24 Dec 2004, 13:11
PSDK July 2000 wrote:

The CreateDialogParam function uses the CreateWindowEx function to create the dialog box. CreateDialogParam then sends a WM_INITDIALOG message (and a WM_SETFONT message if the template specifies the DS_SETFONT or DS_SHELLFONT style) to the dialog box procedure. The function displays the dialog box if the template specifies the WS_VISIBLE style. Finally, CreateDialogParam returns the window handle of the dialog box.

After CreateDialogParam returns, the application displays the dialog box (if it is not already displayed) using the ShowWindow function. The application destroys the dialog box by using the DestroyWindow function. To support keyboard navigation and other dialog box functionality, the message loop for the dialog box must call the IsDialogMessage function.


i guess CreateWindowEx is a bit faster compare to CreateDialogParam coz CreateDialogParam uses CreateWindowEx to create it dialog :p
Post 24 Dec 2004, 13:11
View user's profile Send private message Visit poster's website Reply with quote
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix 24 Dec 2004, 13:19
Thanks, guys!
But what about size of EXE in case of Fresh way of creating a window with a lot of childs? Is it BE (from JBE instruction) dialog or not?
And some words about child dialog boxes: you can create child dialog with resource compiler, and place it on the window in WM_INITDIALOG processing routine. It seems to be something like VCL TPanel (i mean child dialog).

Thanks.
Post 24 Dec 2004, 13:19
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 24 Dec 2004, 13:46
IronFelix wrote:
But what about size of EXE in case of Fresh way of creating a window with a lot of childs? Is it BE (from JBE instruction) dialog or not?


If you are using Fresh library for only one window, it will definately larger than dialog based (another deal is that you have to write a lot of code to make some of the Fresh advanced features).
But the Fresh library is pretty small, so if you have only several forms in your application, the size becomes pretty equal, because you reuse the routines, instead of writing your own code for every Window.
So, if you want to write very small 1k..2k application, Fresh libraryes are not for you. If you need advanced window behaviour, action lists, menues with icons, etc. for middle to big sized application (at least 5k and up) Fresh libraryes will make it as small as possible. For example Fresh lib supports using of .gif images for button and menu icons, this can reduce your resource section many times, compared with .bmp images.

Regards.
Post 24 Dec 2004, 13:46
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.