jhattingh
May 18th, 1999, 08:19 AM
All my Property Pages change their tab caption in InitDialog(), but the InitDialog only gets run when it is first displayed... How do I overcome this "problem"?
|
Click to See Complete Forum and Search --> : How do I initialise all pages in a property sheet? jhattingh May 18th, 1999, 08:19 AM All my Property Pages change their tab caption in InitDialog(), but the InitDialog only gets run when it is first displayed... How do I overcome this "problem"? BrianOG May 18th, 1999, 09:36 AM In the resource editor, change the caption of the dialog that is used for the page to whatever caption you initially require. If the names are not known at design time, you should be able to use the CPropertyPage::m_psp.pszTitle item. Not sure if this overrides the dlg title or not, but it should be worth a try. NOTE: SetWindowText on the propertypage will not work ( and will more than likely cause a CPF) as the actual dialog has not been created yet). Adam Slota May 19th, 1999, 06:22 AM As I know thre are two ways of making OnInitDialog for each property page be called when property sheet is displayed. 1. Call for each page SetActive method in OnInitDialog for CPropertySheet derived object. Just override CYourPropSheet::OnInitDialog() and call SetActive() for every page you have (better to do it in the loop, going from the last one to the first). 2. Before adding the pages to the property sheet add the PSP_PREMATURE to the dwFlags member of the m_psp data member of the page. MyPropPage.m_psp.dwFlags |=3D PSP_PREMATURE; With this flag every page will receive the WM_INITDIALOG a soon as the sheet's DoModal is called. I hope it will help. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |