6.1 How Property Sheet Handlers Work

only for RuBoard - do not distribute or recompile

6.1 How Property Sheet Handlers Work

Property sheet handlers are required to implement two interfaces: IShellExtInit and IShellPropSheetExt . You are already familiar with IShellExtInit (see Chapter 4). IShellPropSheetExt contains only two methods : AddPages , which is called to add a page to a property dialog, and ReplacePage , which, as you might guess, replaces an existing property page. A property sheet handler implements AddPages only. ReplacePage is not implemented, since it applies only to Control Panel objects.

When the Properties menu item is selected for a file object, Explorer initializes the handler by calling IShellExtInit::Initialize . The selected file is passed to the handler via an IDataObject interface. Typically, the property sheet handler would save the name of the file in a private member variable for later use.

Then the shell calls IShellPropSheetExt::AddPages . The implementor of AddPages is required to fill out a PROPSHEETPAGE structure that contains information about the new property page. The structure is then passed to the CreatePropertySheetPage API, and a handle to the newly created property page is returned if the call was successful.

One of the parameters passed in by the shell to AddPages is a function address. The function specified by this address must then be called with the handle to the newly created page as its only parameter. If you are confused , don't worry. We'll go over this in detail when we implement IShellPropSheetExt .

only for RuBoard - do not distribute or recompile


Visual Basic Shell Programming
Visual Basic Shell Programming
ISBN: B00007FY99
EAN: N/A
Year: 2000
Pages: 128

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net