Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the Delphi TTaskDialog be made to use VCLStyles?

Can the Delphi TTaskDialog be made to use VCLStyles?

like image 204
mmmm Avatar asked Dec 16 '22 00:12

mmmm


2 Answers

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.

like image 114
RRUZ Avatar answered Jan 03 '23 00:01

RRUZ


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. :)

like image 40
Arnaud Bouchez Avatar answered Jan 02 '23 23:01

Arnaud Bouchez