Can the Delphi TTaskDialog be made to use VCLStyles?

916 views Asked by At

Can the Delphi TTaskDialog be made to use VCLStyles?

2

There are 2 answers

4
Arnaud Bouchez On BEST ANSWER

AFAIK, and as stated by TLama in his comment, this TTaskDialog just maps Windows API directly, you won't be able to do VCL Style directly.

BUT you may be able to do this, by using a hack similar to the one described in this article about using VCL Styles within a TWebBrowser.

This would be some work, or even not feasible, I suspect. You would have to hack all components created by Windows, which is not easy. The Task Dialog API does not provide a full and detailed COM interface, with a lot of callbacks, ready to be overriden, just like TWebBrowser does.

If you use our Open-Source Task Dialog emulation code as a start, you can enforce to use our emulation layer with pure VCL components. In this case, it will be easy to work with styles. Do not forget to send feedback and a patch to us, in order to let the unit be improved! Other users would like to benefit for such a nice features, I think. This is what is great with Open Source: you start something, publish, then contributions are integrated, and the result gets better. :)

0
RRUZ On

I just added TTaskDialog support to the VCL Styles Utils library.

enter image description here

enter image description here

To activate this feature you need to add these units to your project.

  • Vcl.Styles.Utils.Forms
  • Vcl.Styles.Utils.SysStyleHook
  • Vcl.Styles.Utils.SysControls
  • Vcl.Styles.Hooks

More info can be found on this blog post.