diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-01-01 22:12:51 +0100 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2019-01-01 22:12:51 +0100 |
| commit | 261902fcae887249ffa03114e49afdef85fb4442 (patch) | |
| tree | fbc81a4581dc762d7194f7ee5b9b7b2790319dbf /alf/alfcompat.cpp | |
| parent | dbd2fb78dec385f0abfe07fd4609dc8f444bdefd (diff) | |
first try at combobox implementation
Diffstat (limited to 'alf/alfcompat.cpp')
| -rw-r--r-- | alf/alfcompat.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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; +} |
