Implement the display of non-modular dialogs

xiaoxiao2021-03-06  72

Create a new dialog, select the dialog, right click to select ClassWizard and then prompt you to create a new class for the dialog, click OK, enter your own defined class name, and then generate a class corresponding to the dialog. Assume that the class is CDLGLIST, then add the following code in this class header: cdialog * m_pparent; bool create (); function is implemented as follows: cdlglist :: cdlglist (cdialog * pparent / * = null * /) {M_pparent = pParent;} Bool cdlglist :: create () {return cdialog :: create (cdlglist :: IDD);} then define a cdlglist * listdlg in the main dialog class that calls the non-modular dialog display Realize the display: Listdlg = new cdlglist (this); if (listdlg-> getsafehwnd () == null) listdlg-> create (); else listdlg-> setWindowPos (& WNDnotopmost, Rect.Lep, Rect.top 122, NULL, NULL, SWP_NOSIZE); Listdlg-> ShowWindow (sw_show);

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

New Post(0)