Reputation: 39
Delphi XE2.
For a TForm I do:
hFont := SendMessage(Self.Handle, WM_GETFONT, 0, 0);
But it returns 0. That is, as if the form has a system font. Why is that?
And if I do, for example, like this:
hFont := SendMessage(CheckBox1.Handle, WM_GETFONT, 0, 0);
That returns the correct descriptor.
The same thing, for example, for TPanel - hFont = 0. And for the TButton, the hFont has the correct value.
Upvotes: 2
Views: 527
Reputation: 528
https://devblogs.microsoft.com/oldnewthing/20140724-00/?p=413
The WM_SETFONT and WM_GETFONT messages are not mandatory. A window may choose to support them, or it may choose not to, or it may even choose to support one but not the other. (Though if it supports WM_SETFONT, it probably ought to support WM_GETFONT.)
Upvotes: 2