I have a CPropertySheet with three embedded CPropertyPages. In each page when the user handles some controls, their state is saved in the parent CPropertySheet. When the PropertySheet is dismissed by pressing the OK button, the user selection should be saved in a file. But I do not want the caller of the CPropertySheet to do this saving. Rather I want the CPropertySheet to implement this saving. So I did the following. In the CPropertySheet, I manually added a BN_CLICKED message map entry for IDOK (ClassWizard does not do this). This command handler gets called but the OnKillActive() of the currently visible page is not called (which I badly need). Then I used ClassWizard to add the OnOk handler to one of the pages (and removed this from CPropertysheet). Only when this page is active, this OnOk gets called. When some other page is active, the sheet closes automatically. I do not want to override OnOk() for every page that I add to this sheet, yet I still want the CPropertySheet to handle this message. What should I do? Thanks,
magesh
Posts
-
Handling the OK button in CPropertySheet -
Multi/Single selection in a ListBoxI did not make myself sufficiently clear. I have a list box in a dialog. Depending on an argument to the constructor of the dialog, I want to make this list box either single selection or multi-selection. However, once the selection style is set, It will not change for till the dialog is dismissed. In the resource editor, I'll set selection type to be 'single selection'. Depending on the argument to the constructor, I want to modify the selection type to 'Multi-Selection'. Is there a simple way of doing this without recreating the ctrl or deriving a class from CListBox. I tried ModifyStyle(0, LBS_MULTIPLESEL) in the OnInitDialog() of the dialog. This did not work. Hence this post.
-
Multi/Single selection in a ListBoxI have a dialog with a listbox. For some invocations of the dialog, I want the listbox to be multi-selection and for other invocations, the listbox should be single-select. In OnInitDialog(), I used ModifyStyle() to change the selection style. But this did not work. Is there a solution without subclassing CListBox?
-
Displaying the Property Sheet for a fileI tried the following code fragment from the WM_LBUTTONDOWN handler of an SDI app ShellExecute(this->GetSafeHwnd(), "properties", "c:\\temp\\sharedfile.txt", NULL, "c:\\temp", SW_SHOW); The file exists in the specified directory. This call returns the error code SE_ERR_NOASSOC (0x1f) and does not display the property sheet for the file. What's wrong with this code?
-
Displaying the Property Sheet for a fileI tried the following code fragment from the WM_LBUTTONDOWN handler of an SDI app ShellExecute(this->GetSafeHwnd(), "properties", "c:\\temp\\sharedfile.txt", NULL, "c:\\temp", SW_SHOW); This call returns the error code SE_ERR_NOASSOC (0x1f) and does not display the property sheet for the file. What's wrong with this code?
-
Displaying the Property Sheet for a fileHi, How do I display the same Property Sheet that is shown when we select 'Properties' from the context menu on a file in Windows Explorer. I want to display the properties of a file, but do not want to create a dialog template of my own and populate the dialog with all the information. I want to reuse the resource that Explorer uses. Is this possible? Thanks in advance, Magesh