how to get internal items from a dialog created from wizard of VC2005


1. It is pretty fast and convinient to create a dialog based application from VC2005's
project wizard. But Once you created it, it is very difficult for you to customize it.
For example, modifying a dialog based project into a multi-document one requires much more
efforts than create it from project wizard directly.
2. If, after creating a dialog based application, you want to cutomize it, say changing the
languages, changing some properties of the items. A dialog sceleton contains a label,
instance of CStatic, two buttons, an about dialog and a main dialog(that dialog which will be
showed). Chances are that you want to change the titles or the contents of the label. To do that,
you have to get the instances of the items. Then you can change their properties through their
member functions. To get the instances, you must provide their ids, which are their identifications.
Those items are contained by the main dialog, which is the parent of those items. You can get the
child items through their ids. Here main dialog is the parent and its label and its buttons are
child items. Function:
GetDlgItem(const int id);
are used to retrieve child items from parent instance.
Here to get the label, the two buttons from a typical dialog based applicaiton.

Then you can set properties for those items, e.g. change the title:

你可能感兴趣的:(dialog)