- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can someone please clue me in regarding the use of PropertySheets.
I have dialog procedures written that work (I tested them through other means) and PropertySheetPages and PropertySheetHeader structures populated (I think) according to the SDK documentation; however, I cannot get these two things to work together. The Dialog Procedures are setup to catch WM_NOTIFY messages and no EndDialog commands or zero-valued returns are present within them.
When called, the dialog does seem to appear for about a micro-second and then promptly disappears.
Below is a snippet of code used to setupthe PropertySheets. This is within a subroutine called after a WM_COMMAND is passed to the main window. Furthermore, is that the correct way of doing this, as the documentation is not so clear to me.
Thanks in advance, Richard
!* property sheet creation: **************************************** type (T_PROPSHEETPAGE) :: OptionsPS(0:1) type (T_PROPSHEETHEADER) :: OptionsPSHeader interface integer(4) function NumericsDlgProc( hDlg, message, wParam, lParam ) !DEC$ ATTRIBUTES STDCALL,DECORATE, ALIAS : 'NumericsDlgProc' :: NumericsDlgProc end function end interface interface integer(4) function OutputDlgProc( hDlg, message, wParam, lParam ) !DEC$ ATTRIBUTES STDCALL,DECORATE, ALIAS : 'OutputDlgProc' :: OutputDlgProc end function end interface! create a few property sheets: OptionsPS(0)%dwSize = sizeof(OptionsPS) OptionsPS(0)%dwFlags = PSP_DEFAULT ! + PSP_USETITLE OptionsPS(0)%hInstance = ghInstance OptionsPS(0)%pszTemplate = loc(IDD_NUMERICS) OptionsPS(0)%pszTitle = loc("Set numerical parameters"C) OptionsPS(0)%pfnDlgProc = loc(NumericsDlgProc) ! this proc works otherwise OptionsPS(0)%lParam = 0 OptionsPS(0)%pfnCallback = NULLOptionsPS(1)%dwSize = sizeof(OptionsPS) OptionsPS(1)%dwFlags = PSP_DEFAULT ! + PSP_USETITLE OptionsPS(1)%hInstance = ghInstance OptionsPS(1)%pszTemplate = loc(IDD_OUTPUT) OptionsPS(1)%pszTitle = loc("Select report output"C) OptionsPS(1)%pfnDlgProc = loc(OutputDlgProc) ! this proc works too OptionsPS(1)%lParam = 0 OptionsPS(1)%pfnCallback = NULL! create the header: OptionsPSHeader%dwSize = sizeof(OptionsPSHeader) OptionsPSHeader%dwFlags = PSH_PROPSHEETPAGE OptionsPSHeader%hInstance = ghInstance OptionsPSHeader%hwndParent = ghwndMain OptionsPSHeader%nPages = 2 !sizeof(OptionsPS) OptionsPSHeader%nStartPage = 0 OptionsPSHeader%ppsp = loc(OptionsPS) OptionsPSHeader%pfnCallback = NULLhOptionsPS = PropertySheet(OptionsPSHeader)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Richrd,
The dialog for each tab needs to have the child attibute as Jugoslav noted.
Also, my code sample mentions but omits the essential context-specific activities which need to take place in each dialog when the PSN_SETACTIVE notification message is received. This is where you need to enable the various controls which will be active, check the checkboxes, tell the listboxes which item is currently active, load the editboxes, and so forth. If you don't do these things, blankness could well be the result.
Similarly, you need to explicitly read all your controls each time you get a PSN_KILLACTIVE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav, here is a stripped-down chunk of code from the WM_NOTIFY block of one of the dialog procs: (I think this is what you meant)
select case (hdr%code)
case (PSN_SETACTIVE)
case (PSN_KILLACTIVE)
return
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
return
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That was it exactly.
Thanks Jugoslav!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page