Discussion:
Dialog Boxes in Win32
(too old to reply)
JJ
2014-11-24 02:16:12 UTC
Permalink
Raw Message
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
2014-11-24 08:21:26 UTC
Permalink
Raw Message
Post by JJ
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.
Post by JJ
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
2014-11-25 03:56:21 UTC
Permalink
Raw Message
Post by David Lowndes
Post by JJ
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
2014-11-26 11:46:09 UTC
Permalink
Raw Message
Post by JJ
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.
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 (***@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.)
Loading...