Add dialog control at runtime

xiaoxiao2021-04-05  285

Add a dialog control at runtime:

General steps:

1) Add an embedded control window data member in the dialog class. An inline control C object will be constructed and deleted along with the corresponding dialog object.

2) Select Resource Symbols from the View menu to add an ID constant for the new control. (You can also use definitions in resource.h)

3) Mapping the WM_INITDIALOG message override class cdialog :: OnInitDialog function with the ClassWizard map. Call the CREATE member function of the control window in this function and display the new control (you can use the showwindow function). Windows returns the control window while deleting the dialog window.

4) In the derived dialog class, manually add the necessary notification message control functions for the new control. (3: Message Control Function Protocol Description, Message Mapping, Message Processing Function)

转载请注明原文地址:https://www.9cbs.com/read-132069.html

New Post(0)