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/alf.cpp | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'alf/alf.cpp') diff --git a/alf/alf.cpp b/alf/alf.cpp index ae6c8f9..9d1379c 100644 --- a/alf/alf.cpp +++ b/alf/alf.cpp @@ -519,10 +519,31 @@ ALF_CreateApplication(HINSTANCE hInstance) InitCommonControlsEx(&icc); app->compatFn = ALF_CreateCompatFuncTable(); + ALF_RegisterComboClass(app); return app; } + +void +ALF_BuildRandomClassName(const TCHAR *prefix, TCHAR *buf) +{ + UUID uuid; + UuidCreate(&uuid); + +#ifdef UNICODE + unsigned short *uuidstr = NULL; +#else + unsigned char *uuidstr = NULL; +#endif + UuidToString(&uuid, &uuidstr); + + lstrcpy(buf, prefix); + lstrcat(buf, (LPCTSTR)uuidstr); + + RpcStringFree(&uuidstr); +} + LPTSTR ALF_RegisterWindowClass(ALFAPP app, const ALFWindowClassParams *params) { @@ -535,20 +556,7 @@ ALF_RegisterWindowClass(ALFAPP app, const ALFWindowClassParams *params) ZeroMemory(classNameBuf, sizeof(classNameBuf)); classNamePtr = classNameBuf; - UUID uuid; - UuidCreate(&uuid); - -#ifdef UNICODE - unsigned short *uuidstr = NULL; -#else - unsigned char *uuidstr = NULL; -#endif - UuidToString(&uuid, &uuidstr); - - lstrcpy(classNameBuf, TEXT("ALFWindow.")); - lstrcat(classNameBuf, (LPCTSTR)uuidstr); - - RpcStringFree(&uuidstr); + ALF_BuildRandomClassName(TEXT("ALFWindow."), classNameBuf); } cls.style = params->classStyle; -- cgit v1.2.3