Search code examples
delphidelphi-xe2vcl-stylesttaskdialog

Can the Delphi TTaskDialog be made to use VCLStyles?


Can the Delphi TTaskDialog be made to use VCLStyles?


Solution

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