質問

Can the Delphi TTaskDialog be made to use VCLStyles?

役に立ちましたか?

解決

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

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top