diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-06-24 11:19:34 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-06-24 11:19:34 +0200 |
| commit | cd9b72745abd06012777f130f1f19c4ae853489d (patch) | |
| tree | c2bbf90ea7618d82faae560d42f268f62567168a /alf/alf.cpp | |
| parent | 02c1f4e9165084589941ce205defaf5f3f1ea90f (diff) | |
messagedlg: initial implementation
Diffstat (limited to 'alf/alf.cpp')
| -rw-r--r-- | alf/alf.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp index 1bcbce3..c2f99ce 100644 --- a/alf/alf.cpp +++ b/alf/alf.cpp @@ -75,6 +75,31 @@ ALF_Free(const void *p) HeapFree(GetProcessHeap(), 0, (void*)p); } +TCHAR * +ALF_StrDup(const TCHAR *psz) +{ + int l = lstrlen(psz); + TCHAR *r = ALF_New(TCHAR, (SIZE_T)l + 1); + CopyMemory(r, psz, ((SIZE_T)l + 1) * sizeof(TCHAR)); + return r; +} + +TCHAR * +ALF_StrOrIntresourceDup(const TCHAR *psz) +{ + if (IS_INTRESOURCE(psz)) + return (TCHAR *)psz; + else + return ALF_StrDup(psz); +} + +void +ALF_StrOrIntresourceFree(const TCHAR *psz) +{ + if (!IS_INTRESOURCE(psz)) + ALF_Free(psz); +} + int ALF_CentipointsToPixels(int cptValue, int dpi) { |
