I'm converting an older Delphi 7 app to Unicode with the help of TNT Controls.
Replaced a bunch of VCL components with their TNT counterparts.
I'm assigning widechar to Captions of TntButton, TntCheckboxes etc and it works fine. Russian, Chinese etc text is displayed correctly. But if I set any widechar string to TNTButton.Hint or TntCheckbox.Hint and set the ShowHint property to True all I see is ?????? instead of the unicode text as the hint. Tried on Windows 7 and 10, with the same result.
I suspect that the hint font you use is not a unicode supporting font. In this article, you can find a technique to specify the hint font:
This was the responsible code:
type
TShadowedHintWindow = class (THintWindow)
protected
procedure CreateParams(var Params: TCreateParams); override;
end;
implementation
{ TShadowedHintWindow }
procedure TShadowedHintWindow.CreateParams(var Params: TCreateParams);
const
CS_DROPSHADOW = $00020000;
begin
inherited;
{ Enable drop shadow effect on Windows XP and later }
if (Win32Platform = VER_PLATFORM_WIN32_NT) and
((Win32MajorVersion > 5) or
((Win32MajorVersion = 5) and (Win32MinorVersion >= 1))) then
Params.WindowClass.Style := Params.WindowClass.Style or CS_DROPSHADOW;
end;
initialization
HintWindowClass := TShadowedHintWindow;
end.
Thanks for informing. The default THintWindow class in Delphi 7 is a non-unicode window class.