From 261902fcae887249ffa03114e49afdef85fb4442 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Tue, 1 Jan 2019 22:12:51 +0100 Subject: first try at combobox implementation --- alf/alfcompat.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'alf/alfcompat.cpp') diff --git a/alf/alfcompat.cpp b/alf/alfcompat.cpp index e6a9851..269b9f4 100644 --- a/alf/alfcompat.cpp +++ b/alf/alfcompat.cpp @@ -123,3 +123,14 @@ ALF_CreateCompatFuncTable(void) return compatfn; } + +long +ALF_GetAveCharWidth(HDC hdc) +{ + // see: HOWTO: Calculate Dialog Units When Not Using the System Font + + SIZE s; + GetTextExtentPoint32A(hdc, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 52, &s); + + return (s.cx / 26 + 1) / 2; +} -- cgit v1.2.3