As of Delphi XE6, the VCL also styles non-VCL controls, but this truncates the texts to 256 characters, for instance in non-balloon hints. This is fixed in Delphi 10.2 Berlin, by making the buffer dynamic and switching obtaining those texts from using GetWindowText to sending a WM_GETTEXT message.
A fix for Delphi XE6..10.1 Berlin is at gitlab.com/wiert.me/public/delphi/DelphiVclStylesAndHintText, with many thanks to Stefan Glienke who based the patch on the ones used in Spring4D. I think they are similar to the ones in [Archive.is] VCL Fix Pack 1.4 | Andy’s Blog and Tools.
The Old New Thing explains the difference between GetWindowText
and WM_GETTEXT
in [WayBack] The secret life of GetWindowText – The Old New Thing. TL;DR:
GetWindowText strikes a compromise.
- If you are trying to GetWindowText() from a window in your own process, then GetWindowText() will send the WM_GETTEXT message.
- If you are trying to GetWindowText() from a window in another process, then GetWindowText() will use the string from the “special place” and not send a message.
So for your own process, it does not matter as GetWindowText
uses WM_GETTEXT
.
–jeroen
Related:
- [WayBack] delphi – How to patch a method in Classes.pas – Stack Overflow
- [WayBack] TreeNT at Soft Gems – homepage of the software library of Mike Lischke
- [WayBack] delphi – Add Unicode support to TreeNT component – Stack Overflow
- [WayBack] keynote-nf/3rd_party/treent at master · dpradov/keynote-nf · GitHub