Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dialog as main Window?

Is it usual to use a Dialog as main Windows? So without registering any user class via RegisterClassEx? Can I do everything I do via CreateWindow()? Why should I create controls such as buttons,editboxes etc via CreateWindow() instead of just making a Dialog and use it as main Window?

I'd also like to know main difference between a dialog and a windows and why use one the first instead of the second.

Thanks

like image 569
user1365914 Avatar asked Jun 19 '12 21:06

user1365914


1 Answers

Is it usual to use a Dialog as main Windows?

Yes, it is quite common.

So without registering any user class via RegisterClassEx?

A dialog is usually a predefined window class, so there usually no need for registering.

I'd also like to know main difference between a dialog and a windows and why use one the first instead of the second.

Well, two big differences would be that you cannot resize a dialog box and it has no minimize or maximize buttons (by default, but there are workarounds for this). Keep in mind the name, dialog box. In other words they are used for having a dialog with the user (receive input and displays messages to user). In a sense they are just like any other window, underneath CreateWindowxx, etc. is called, etc. However, they are somewhat predefined windows which can be made quickly and there are limitations to what you can do with them.

Also, a dialog uses a dialog procedure rather than a window procedure, which does some default processing for you, such as initializing some controls, etc.

like image 174
Jesse Good Avatar answered Sep 25 '22 05:09

Jesse Good