Jump to content
FPiette

Writing a property sheet shell extension (IShellPropSheetExt)

Recommended Posts

Hello,

 

I'm trying to write a shell property sheet extension.

 

The DLL with the COM object is not an issue for me since I already done that kind of work with my context menu extension (That's easy with Delphi). But for a property sheet extension, the COM object must implement IShellPropSheetExt. In that interface AddPage method must create the UI. There are many C++ examples on the web but I did not found any Delphi example. The C++ examples all use the old Windows dialog box feature. I don't want to use a windows dialog box but a Delphi form. I have no idea how to do that and search for some Delphi example or tutorial (Already done extensive Google searches without success).

 

Any help will be appreciated!

Thanks.

Share this post


Link to post

I can't see any way to create a property sheet without using a dialog template.

Maybe you can just use an empty dialog template and then inject your Delphi form when the page is displayed?

Share this post


Link to post
8 minutes ago, Anders Melander said:

Maybe you can just use an empty dialog template and then inject your Delphi form when the page is displayed?

A Delphi VCL form is a standard window. It is probably possible to overload a dialogbox control using a parented Delphi form. That's what I'm trying to do to begin.

 

Share this post


Link to post
2 minutes ago, FPiette said:

A Delphi VCL form is a standard window. It is probably possible to overload a dialogbox control using a parented Delphi form.

Yes; That's what I wrote.

 

procedure InjectMyForm(HandleOfControlOnPropertyPage: HWND; MyForm: TForm);
begin
  SetParent(MyForm.Handle, HandleOfControlOnPropertyPage);
  ...lots of stuff to do with positioning and window style...
end;

 

  • Like 1

Share this post


Link to post
On 2/9/2023 at 12:40 PM, Anders Melander said:

Maybe you can just use an empty dialog template and then inject your Delphi form when the page is displayed?

That's what I have done and it works.

The trick is to use an empty template and then from WM_INITDIALOG create a parented Delphi VCL form.

  • Like 1
  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×