max
max

Reputation: 63

Get titlebar text size WINAPI

How to get the (text size or height) of the titlebar.
I tried to use GetSystemMetrics(SM_CYCAPTION) but it returns the height of the titlebar not the text size.
Any suggestions?

Upvotes: 0

Views: 495

Answers (1)

David Heffernan
David Heffernan

Reputation: 612794

Call SystemParametersInfo passing SPI_GETNONCLIENTMETRICS. This will populate a NONCLIENTMETRICS structure. Within that structure is lfCaptionFont which contains the information you desire.

Upvotes: 3

Related Questions