summaryrefslogtreecommitdiff
path: root/alf/alf.cpp
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2020-04-27 17:09:25 +0200
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2020-04-27 17:09:25 +0200
commit7ebda0eb50ad2972a93cc6f597b22c9d4473f304 (patch)
tree0e4df6c5fd4676ba139e142aa0fac3e332b6d1da /alf/alf.cpp
parent2f9bdf479c438a9f2e1129e5787db6e079c2204b (diff)
button: make themed button always use unicode and do internal text handling
Diffstat (limited to 'alf/alf.cpp')
-rw-r--r--alf/alf.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/alf/alf.cpp b/alf/alf.cpp
index 917008a..25dcd21 100644
--- a/alf/alf.cpp
+++ b/alf/alf.cpp
@@ -124,6 +124,23 @@ ALF_BuildUniqueName(TCHAR *buf, const TCHAR *prefix, ULONG_PTR uniquifier)
}
void
+ALF_BuildUniqueNameW(WCHAR *buf, const WCHAR *prefix, ULONG_PTR uniquifier)
+{
+ int prefixlen = lstrlenW(prefix);
+ CopyMemory(buf, prefix, (SIZE_T)prefixlen * sizeof(*prefix));
+
+ int numlen = sizeof(LONG_PTR)*2;
+ int i = numlen - 1;
+ while (i >= 0) {
+ buf[prefixlen + i] = L"0123456789ABCDEF"[uniquifier & 0xf];
+ uniquifier >>= 4;
+ i--;
+ }
+
+ buf[prefixlen + numlen] = 0;
+}
+
+void
ALF_DestroyWindow(HWND win)
{
DestroyWindow(win);