My question is simple: What is the difference between Dialog Box and CreateWindow? IMHO One can create Dialog Box in a Resource editor, insert a button or insert an edit box. This is the easy part. Next question - where is my button handle? How do I place a bitmap on top of my button or color? Now: CreateWindowEx - main CreateWindowEx - button CreateWindowEx - edit There is much more typing and sizing than in the resource editor, but from now on it is very easy from the messages to subclassing. Why do most beginners insist on using Dialogs ???? forge :)
Posted on 2001-03-28 06:05:00 by forge
forge, Funny enough, both dialogs and normal wondows are created by CreateWindowEx, the difference is that a dialog is fed through the internal windows dialog engine so it is specified in dialog units for dimensions rather than pixels as in CreateWindowEx directly. A dialog's size is basically determined by the size of the system font so that if a dialog app is run on a machine with a different font size, it autosizes and displays in proportion to the system font. Dialogs are easier to code but CreateWindowEx is more powerful as you can do many more things with it. The price of going lower level is that you must do more coding to get the extra power. Dialogs automate things like tab movement between controls so basically if you need to code a window with many controls on it, a dialog is the best choice but if you need to write a window style app and do your own autosizing, CreateWindowEx is a better choice. The bitmap buttons are in an example in the MASM32 example code, you have the choice of normal single bitmap buttons are a trick to do seperate UP and DOWN bbitmaps on the button. Regards, hutch@pbq.com.au
Posted on 2001-03-28 06:49:00 by hutch--
Hutch, Thanks for a very comprehensive answer and explanation.
CreateWindowEx is more powerful as you can do many more things with it.
I will stick with it. I wish that there where some cross breed between Resource Editor and Resource Hacker which will at least record the position and size of the windows in pixels. forge
Posted on 2001-03-29 08:00:00 by forge