Dialog Boxes in Win32

12 views
Skip to first unread message

JJ

unread,
Nov 23, 2014, 9:16:13 PM11/23/14
to
Hello.

I'm reading theForger's Win32 tutorial, up to the Dialog box chapter.
First they create a window, using RgisterClassEx and CreateWindowEx, and
then they teach to create a dialog box.

I had just finnished creating a dialog box, and then I went a little
further and removed the RegisterWindowEx at all, stuff, leaving just the
DialogBox(), and removed the message loop as well (so that when the
dialog is closed the app ends too).

My question is: given that it is much simpler to code an app like this,
why should I create my own window class? I perfectly understand that for
serious apps this may not be enough. But given that every tutorial on
earth says that the "minimal win32 gui app" is an app that calls
RegisterClassEx it makes me feel if I'm seeng things corretly.

Parhaps my dialog-only app only works in Wine... :-)

Thanks,
JJ

David Lowndes

unread,
Nov 24, 2014, 3:21:18 AM11/24/14
to
>My question is: given that it is much simpler to code an app like this,
>why should I create my own window class?

If a simple application that's just a dialog is what you need, then
there's no reason to register/create your own windows.

> But given that every tutorial on
>earth says that the "minimal win32 gui app" is an app that calls
>RegisterClassEx it makes me feel if I'm seeng things corretly.

I think that's just a historical thing that everyone wants to
demonstrate drawing something in their own window to illustrate the
principal.

Dave

JJ

unread,
Nov 24, 2014, 10:56:22 PM11/24/14
to
On 24-11-2014 08:21, David Lowndes wrote:
>> But given that every tutorial on
>> earth says that the "minimal win32 gui app" is an app that calls
>> RegisterClassEx it makes me feel if I'm seeng things corretly.
>
> I think that's just a historical thing that everyone wants to
> demonstrate drawing something in their own window to illustrate the
> principal.

Thanks...
I was also trying to do something else, which is enumerating the objects
in the root of NT object namespace...
Function NtQueryDirectoryObject is giving me 0xC0000022, which means
STATUS_ACCESS_DENIED.
I'm trying to figure out what's happening, and if I cannot, I'll post
here my program...

JJ

Deanna Earley

unread,
Nov 26, 2014, 6:47:16 AM11/26/14
to
A dialog is fine for a single dialog.
If you want more Windows with different lifetimes, or anything more
complicated then you will need to move to custom windows and your own
message pump.

--
Deanna Earley (dee.e...@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be printed, shredded then fed
to the rats. Please reply to the group.)
Reply all
Reply to author
Forward
0 new messages