ReactOS 0.4.15-dev-7988-g06a3508
mlng.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS msctf.dll
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Multi-language handling of Cicero
5 * COPYRIGHT: Copyright 2024 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#define WIN32_NO_STATUS
9
10#include <windows.h>
11#include <shellapi.h>
12#include <imm.h>
13#include <imm32_undoc.h>
14#include <shlobj.h>
15#include <shlwapi.h>
16#include <shlwapi_undoc.h>
17#include <msctf.h>
18#include <strsafe.h>
19#include <assert.h>
20
21#include <cicreg.h>
22#include <cicarray.h>
23
24#include <wine/debug.h>
25
26#include "mlng.h"
27
29
31
36
37// Cache for GetSpecialKLID
40
41/***********************************************************************
42 * The helper funtions
43 */
44
47{
49
50 if (s_hCacheKL == hKL && s_dwCacheKLID != 0)
51 return s_dwCacheKLID;
52
53 s_dwCacheKLID = 0;
54
55 CicRegKey regKey1;
57 L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts");
58 if (error != ERROR_SUCCESS)
59 return 0;
60
61 WCHAR szName[16], szLayoutId[16];
62 const DWORD dwSpecialId = SPECIALIDFROMHKL(hKL);
63 for (DWORD dwIndex = 0; ; ++dwIndex)
64 {
65 error = ::RegEnumKeyW(regKey1, dwIndex, szName, _countof(szName));
66 szName[_countof(szName) - 1] = UNICODE_NULL; // Avoid buffer overrun
67 if (error != ERROR_SUCCESS)
68 break;
69
70 CicRegKey regKey2;
71 error = regKey2.Open(regKey1, szName);
72 if (error != ERROR_SUCCESS)
73 break;
74
75 error = regKey2.QuerySz(L"Layout Id", szLayoutId, _countof(szLayoutId));
76 szLayoutId[_countof(szLayoutId) - 1] = UNICODE_NULL; // Avoid buffer overrun
77 if (error == ERROR_SUCCESS)
78 continue;
79
80 DWORD dwLayoutId = wcstoul(szLayoutId, NULL, 16);
81 if (dwLayoutId == dwSpecialId)
82 {
83 s_hCacheKL = hKL;
85 break;
86 }
87 }
88
89 return s_dwCacheKLID;
90}
91
94{
95 if (IS_IME_HKL(hKL))
96 return HandleToUlong(hKL);
97
98 DWORD dwKLID;
99 if (HIWORD(hKL) == LOWORD(hKL))
100 dwKLID = LOWORD(hKL);
101 else if (IS_SPECIAL_HKL(hKL))
102 dwKLID = GetSpecialKLID(hKL);
103 else
104 dwKLID = HandleToUlong(hKL);
105
106 if (dwKLID == 0)
107 return HandleToUlong(hKL);
108
109 CicRegKey regKey;
110 LSTATUS error = regKey.Open(HKEY_CURRENT_USER, L"Keyboard Layout\\Substitutes");
111 if (error == ERROR_SUCCESS)
112 {
113 WCHAR szName[MAX_PATH], szValue[MAX_PATH];
114 DWORD dwIndex, dwValue;
115 for (dwIndex = 0; ; ++dwIndex)
116 {
117 error = regKey.EnumValue(dwIndex, szName, _countof(szName));
118 szName[_countof(szName) - 1] = UNICODE_NULL; // Avoid buffer overrun
119 if (error != ERROR_SUCCESS)
120 break;
121
122 error = regKey.QuerySz(szName, szValue, _countof(szValue));
123 szValue[_countof(szValue) - 1] = UNICODE_NULL; // Avoid buffer overrun
124 if (error != ERROR_SUCCESS)
125 break;
126
127 dwValue = wcstoul(szValue, NULL, 16);
128 if ((dwKLID & ~SPECIAL_MASK) == dwValue)
129 {
130 dwKLID = wcstoul(szName, NULL, 16);
131 break;
132 }
133 }
134 }
135
136 return dwKLID;
137}
138
140static BOOL
142{
143 const DWORD dwKLID = GetHKLSubstitute(hKL);
144
145 WCHAR szSubKey[MAX_PATH];
146 StringCchPrintfW(szSubKey, _countof(szSubKey),
147 L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\%08lX",
148 dwKLID);
149
150 CicRegKey regKey;
151 LSTATUS error = regKey.Open(HKEY_LOCAL_MACHINE, szSubKey);
152 if (error != ERROR_SUCCESS)
153 return FALSE;
154
155 if (SHLoadRegUIStringW(regKey, L"Layout Display Name", pszDesc, cchDesc) == S_OK)
156 {
157 pszDesc[cchDesc - 1] = UNICODE_NULL; // Avoid buffer overrun
158 return TRUE;
159 }
160
161 error = regKey.QuerySz(L"Layout Text", pszDesc, cchDesc);
162 pszDesc[cchDesc - 1] = UNICODE_NULL; // Avoid buffer overrun
163 return (error == ERROR_SUCCESS);
164}
165
167static BOOL
168GetHKLName(_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc)
169{
170 if (::GetLocaleInfoW(LOWORD(hKL), LOCALE_SLANGUAGE, pszDesc, cchDesc))
171 return TRUE;
172
173 *pszDesc = UNICODE_NULL;
174
175 if (LOWORD(hKL) == HIWORD(hKL))
176 return FALSE;
177
178 return GetKbdLayoutNameFromReg(hKL, pszDesc, cchDesc);
179}
180
182static BOOL
184 _In_ HKL hKL,
185 _Out_ LPWSTR pszDesc,
186 _In_ UINT cchDesc,
187 _Out_ LPWSTR pszImeFileName,
188 _In_ UINT cchImeFileName)
189{
190 pszDesc[0] = pszImeFileName[0] = UNICODE_NULL;
191
192 if (!IS_IME_HKL(hKL))
193 return GetHKLName(hKL, pszDesc, cchDesc);
194
195 if (GetKbdLayoutNameFromReg(hKL, pszDesc, cchDesc))
196 return TRUE;
197
198 if (!::ImmGetDescriptionW(hKL, pszDesc, cchDesc))
199 {
200 *pszDesc = UNICODE_NULL;
201 return GetHKLName(hKL, pszDesc, cchDesc);
202 }
203
204 if (!::ImmGetIMEFileNameW(hKL, pszImeFileName, cchImeFileName))
205 *pszImeFileName = UNICODE_NULL;
206
207 return TRUE;
208}
209
212{
213 HICON hIcon;
214
217 else
218 ::ExtractIconExW(pszFileName, iIcon, &hIcon, NULL, 1);
219
220 return hIcon;
221}
222
225{
228
229 return TRUE;
230}
231
234{
235 HDC hDC = ::GetDC(NULL);
237 HGDIOBJ hFontOld = ::SelectObject(hDC, hFont);
240 INT ret = tm.tmExternalLeading + tm.tmHeight;
241 ::SelectObject(hDC, hFontOld);
244 return ret;
245}
246
247/***********************************************************************
248 * Inat helper functions
249 */
250
253{
254 if (!EnsureIconImageList())
255 return -1;
256 return g_IconList.AddIcon(hIcon);
257}
258
260HICON
263 _In_ INT nWidth,
264 _In_ INT nHeight,
265 _In_ const LOGFONTW *plf)
266{
267 WCHAR szText[64];
269 szText, _countof(szText));
270 if (!ret)
271 szText[0] = szText[1] = L'?';
272
273 szText[2] = UNICODE_NULL;
274 CharUpperW(szText);
275
277 if (!hFont)
278 return NULL;
279
280 HDC hDC = ::GetDC(NULL);
281 HDC hMemDC = ::CreateCompatibleDC(hDC);
282 HBITMAP hbmColor = ::CreateCompatibleBitmap(hDC, nWidth, nHeight);
283 HBITMAP hbmMask = ::CreateBitmap(nWidth, nHeight, 1, 1, NULL);
285
286 HICON hIcon = NULL;
287 HGDIOBJ hbmOld = ::SelectObject(hMemDC, hbmColor);
288 HGDIOBJ hFontOld = ::SelectObject(hMemDC, hFont);
289 if (hMemDC && hbmColor && hbmMask)
290 {
293
294 RECT rc = { 0, 0, nWidth, nHeight };
295 ::ExtTextOutW(hMemDC, 0, 0, ETO_OPAQUE, &rc, L"", 0, NULL);
296
297 ::DrawTextW(hMemDC, szText, 2, &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
298 ::SelectObject(hMemDC, hbmMask);
299
300 ::PatBlt(hMemDC, 0, 0, nWidth, nHeight, BLACKNESS);
301
302 ICONINFO IconInfo = { TRUE, 0, 0, hbmMask, hbmColor };
304 }
305 ::SelectObject(hMemDC, hFontOld);
306 ::SelectObject(hMemDC, hbmOld);
307
308 ::DeleteObject(hbmMask);
309 ::DeleteObject(hbmColor);
310 ::DeleteDC(hMemDC);
312 return hIcon;
313}
314
317{
319
320 LOGFONTW lf;
322 return NULL;
323
324 if (cySmIcon < GetPhysicalFontHeight(&lf))
325 {
326 lf.lfWidth = 0;
327 lf.lfHeight = - (7 * cySmIcon) / 10;
328 }
329
330 return InatCreateIconBySize(LangID, cxSmIcon, cySmIcon, &lf);
331}
332
335{
336 g_IconList.GetIconSize(pcx, pcy);
337 return TRUE;
338}
339
342{
343 return g_IconList.GetImageCount();
344}
345
348{
351}
352
355{
357
358 if (g_pMlngInfo)
359 {
360 delete g_pMlngInfo;
362 }
363}
364
365/***********************************************************************
366 * MLNGINFO
367 */
368
371{
372 if (m_bInitDesc)
373 return;
374
375 WCHAR szDesc[MAX_PATH], szImeFileName[MAX_PATH];
376 GetHKLDesctription(m_hKL, szDesc, (UINT)_countof(szDesc),
377 szImeFileName, (UINT)_countof(szImeFileName));
378 SetDesc(szDesc);
380}
381
384{
385 if (m_bInitIcon)
386 return;
387
388 WCHAR szDesc[MAX_PATH], szImeFileName[MAX_PATH];
389 GetHKLDesctription(m_hKL, szDesc, (UINT)_countof(szDesc),
390 szImeFileName, (UINT)_countof(szImeFileName));
391 SetDesc(szDesc);
393
394 INT cxIcon, cyIcon;
395 InatGetIconSize(&cxIcon, &cyIcon);
396
397 HICON hIcon = NULL;
398 if (szImeFileName[0])
399 hIcon = GetIconFromFile(cxIcon, cyIcon, szImeFileName, 0);
400
401 if (!hIcon)
403
404 if (hIcon)
405 {
408 }
409
411}
412
415{
416 if (!m_bInitDesc)
417 InitDesc();
418
419 return m_szDesc;
420}
421
424{
426}
427
430{
431 if (!m_bInitIcon)
432 InitIcon();
433
434 return m_iIconIndex;
435}
436
437/***********************************************************************
438 * CStaticIconList
439 */
440
442void CStaticIconList::Init(INT cxIcon, INT cyIcon)
443{
445 s_cx = cxIcon;
446 s_cy = cyIcon;
448}
449
452{
454
455 INT iItem = -1;
456 HICON hCopyIcon = ::CopyIcon(hIcon);
457 if (hCopyIcon)
458 {
459 if (g_IconList.Add(hIcon))
460 iItem = INT(g_IconList.size() - 1);
461 }
462
464 return iItem;
465}
466
469{
470 HICON hCopyIcon = NULL;
472 if (iIcon <= (INT)g_IconList.size())
473 hCopyIcon = ::CopyIcon(g_IconList[iIcon]);
475 return hCopyIcon;
476}
477
480{
482 *pcx = s_cx;
483 *pcy = s_cy;
485}
486
489{
491 INT cItems = (INT)g_IconList.size();
493 return cItems;
494}
495
498{
499 if (!bNoLock)
501
502 for (size_t iItem = 0; iItem < g_IconList.size(); ++iItem)
503 {
505 }
506
507 clear();
508
509 if (!bNoLock)
511}
512
515{
516 if (!g_pMlngInfo)
517 return TRUE; // Needs creation
518
520 if (cKLs != TF_MlngInfoCount())
521 return TRUE; // Needs refresh
522
523 if (!cKLs)
524 return FALSE;
525
526 HKL *phKLs = (HKL*)cicMemAlloc(cKLs * sizeof(HKL));
527 if (!phKLs)
528 return FALSE;
529
530 ::GetKeyboardLayoutList(cKLs, phKLs);
531
533
534 BOOL ret = FALSE;
535 for (INT iKL = 0; iKL < cKLs; ++iKL)
536 {
537 if ((*g_pMlngInfo)[iKL].m_hKL != phKLs[iKL])
538 {
539 ret = TRUE; // Needs refresh
540 break;
541 }
542 }
543
544 cicMemFree(phKLs);
545 return ret;
546}
547
550{
551 if (!g_pMlngInfo)
552 return;
553
554 delete g_pMlngInfo;
556}
557
560{
561 if (!g_pMlngInfo)
562 {
564 if (!g_pMlngInfo)
565 return;
566 }
567
568 if (!EnsureIconImageList())
569 return;
570
572 HKL *phKLs = (HKL*)cicMemAllocClear(cKLs * sizeof(HKL));
573 if (!phKLs)
574 return;
575
576 ::GetKeyboardLayoutList(cKLs, phKLs);
577
578 for (INT iKL = 0; iKL < cKLs; ++iKL)
579 {
580 MLNGINFO& info = (*g_pMlngInfo)[iKL];
581 info.m_hKL = phKLs[iKL];
582 info.m_bInitDesc = FALSE;
583 info.m_bInitIcon = FALSE;
584 }
585
586 cicMemFree(phKLs);
587}
588
589/***********************************************************************
590 * TF_InitMlngInfo (MSCTF.@)
591 *
592 * @implemented
593 */
595{
596 TRACE("()\n");
597
599
600 if (CheckMlngInfo())
601 {
604 }
605
607}
608
609/***********************************************************************
610 * TF_MlngInfoCount (MSCTF.@)
611 *
612 * @implemented
613 */
615{
616 TRACE("()\n");
617
618 if (!g_pMlngInfo)
619 return 0;
620
621 return (INT)g_pMlngInfo->size();
622}
623
624/***********************************************************************
625 * TF_InatExtractIcon (MSCTF.@)
626 *
627 * @implemented
628 */
630{
631 TRACE("(%d)\n", iKL);
632 return g_IconList.ExtractIcon(iKL);
633}
634
635/***********************************************************************
636 * TF_GetMlngIconIndex (MSCTF.@)
637 *
638 * @implemented
639 */
641{
642 TRACE("(%d)\n", iKL);
643
644 INT iIcon = -1;
645
647
649
650 if (iKL < (INT)g_pMlngInfo->size())
651 iIcon = (*g_pMlngInfo)[iKL].GetIconIndex();
652
654
655 return iIcon;
656}
657
658/***********************************************************************
659 * TF_GetMlngHKL (MSCTF.@)
660 *
661 * @implemented
662 */
665 _In_ INT iKL,
666 _Out_opt_ HKL *phKL,
667 _Out_opt_ LPWSTR pszDesc,
668 _In_ INT cchDesc)
669{
670 TRACE("(%d, %p, %p, %d)\n", iKL, phKL, pszDesc, cchDesc);
671
672 BOOL ret = FALSE;
673
675
677
678 if (iKL < (INT)g_pMlngInfo->size())
679 {
680 MLNGINFO& info = (*g_pMlngInfo)[iKL];
681
682 if (phKL)
683 *phKL = info.m_hKL;
684
685 if (pszDesc)
686 StringCchCopyW(pszDesc, cchDesc, info.GetDesc());
687
688 ret = TRUE;
689 }
690
692
693 return ret;
694}
static HDC hDC
Definition: 3dtext.c:33
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
HFONT hFont
Definition: main.c:53
#define SPECIAL_MASK
Definition: debug.h:13
#define HandleToUlong(h)
Definition: basetsd.h:79
#define EXTERN_C
Definition: basetyps.h:12
static LPVOID cicMemAlloc(SIZE_T size)
Definition: cicbase.h:10
#define cicNoThrow
Definition: cicbase.h:34
static void cicMemFree(LPVOID ptr)
Definition: cicbase.h:27
static LPVOID cicMemAllocClear(SIZE_T size)
Definition: cicbase.h:15
void GetIconSize(INT *pcx, INT *pcy)
@implemented
Definition: mlng.cpp:479
void Init(INT cxIcon, INT cyIcon)
@implemented
Definition: mlng.cpp:442
INT AddIcon(HICON hIcon)
@implemented
Definition: mlng.cpp:451
void RemoveAll(BOOL bNoLock)
@implemented
Definition: mlng.cpp:497
HICON ExtractIcon(INT iIcon)
@implemented
Definition: mlng.cpp:468
static INT s_cy
Definition: mlng.h:30
static INT s_cx
Definition: mlng.h:29
INT GetImageCount()
@implemented
Definition: mlng.cpp:488
size_t size() const
Definition: cicarray.h:34
BOOL Add(const T_ITEM &item)
Definition: cicarray.h:60
LSTATUS QuerySz(LPCTSTR pszValueName, LPTSTR pszValue, DWORD cchValueMax)
Definition: cicreg.h:84
LSTATUS Open(HKEY hKey, LPCTSTR lpSubKey, REGSAM samDesired=KEY_READ)
Definition: cicreg.h:51
LSTATUS EnumValue(DWORD dwIndex, LPTSTR lpValueName, DWORD cchValueName)
Definition: cicreg.h:108
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
Definition: reg.c:2393
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
Definition: ime.c:1112
UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
Definition: ime.c:1182
HRESULT WINAPI SHLoadRegUIStringW(HKEY hkey, LPCWSTR value, LPWSTR buf, DWORD size)
Definition: ordinal.c:4240
#define assert(x)
Definition: debug.h:53
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:849
#define SPECIALIDFROMHKL(hKL)
Definition: imm32_undoc.h:22
#define IS_SPECIAL_HKL(hKL)
Definition: imm32_undoc.h:21
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:20
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Out_opt_ PICONINFO IconInfo
Definition: ntuser.h:2294
#define S_OK
Definition: intsafe.h:52
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1108
USHORT LANGID
Definition: mui.h:9
#define error(str)
Definition: mkdosfs.c:1605
static HKL s_hCacheKL
Definition: mlng.cpp:38
static VOID CreateMlngInfo(VOID)
@implemented
Definition: mlng.cpp:559
static VOID DestroyMlngInfo(VOID)
@implemented
Definition: mlng.cpp:549
HICON GetIconFromFile(_In_ INT cx, _In_ INT cy, _In_ LPCWSTR pszFileName, _In_ INT iIcon)
@implemented
Definition: mlng.cpp:211
CStaticIconList g_IconList
Definition: mlng.cpp:35
HICON InatCreateIconBySize(_In_ LANGID LangID, _In_ INT nWidth, _In_ INT nHeight, _In_ const LOGFONTW *plf)
@implemented
Definition: mlng.cpp:261
EXTERN_C BOOL WINAPI TF_GetMlngHKL(_In_ INT iKL, _Out_opt_ HKL *phKL, _Out_opt_ LPWSTR pszDesc, _In_ INT cchDesc)
Definition: mlng.cpp:664
DWORD GetHKLSubstitute(_In_ HKL hKL)
@implemented
Definition: mlng.cpp:93
VOID InatRemoveAll(VOID)
@implemented
Definition: mlng.cpp:347
static BOOL GetHKLName(_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc)
@implemented
Definition: mlng.cpp:168
static BOOL CheckMlngInfo(VOID)
@implemented
Definition: mlng.cpp:514
CRITICAL_SECTION g_cs
Definition: utils.cpp:39
INT InatAddIcon(_In_ HICON hIcon)
@implemented
Definition: mlng.cpp:252
static BOOL GetHKLDesctription(_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc, _Out_ LPWSTR pszImeFileName, _In_ UINT cchImeFileName)
@implemented
Definition: mlng.cpp:183
DWORD GetSpecialKLID(_In_ HKL hKL)
@implemented
Definition: mlng.cpp:46
HICON InatCreateIcon(_In_ LANGID LangID)
@implemented
Definition: mlng.cpp:316
static DWORD s_dwCacheKLID
Definition: mlng.cpp:39
INT InatGetImageCount(VOID)
@implemented
Definition: mlng.cpp:341
EXTERN_C INT WINAPI TF_GetMlngIconIndex(_In_ INT iKL)
Definition: mlng.cpp:640
static BOOL EnsureIconImageList(VOID)
@implemented
Definition: mlng.cpp:224
static BOOL GetKbdLayoutNameFromReg(_In_ HKL hKL, _Out_ LPWSTR pszDesc, _In_ UINT cchDesc)
@implemented
Definition: mlng.cpp:141
VOID UninitINAT(VOID)
@implemented
Definition: mlng.cpp:354
EXTERN_C HICON WINAPI TF_InatExtractIcon(_In_ INT iKL)
Definition: mlng.cpp:629
BOOL InatGetIconSize(_Out_ INT *pcx, _Out_ INT *pcy)
@implemented
Definition: mlng.cpp:334
CicArray< MLNGINFO > * g_pMlngInfo
Definition: mlng.cpp:32
EXTERN_C INT WINAPI TF_MlngInfoCount(VOID)
Definition: mlng.cpp:614
static INT GetPhysicalFontHeight(LOGFONTW *plf)
@implemented
Definition: mlng.cpp:233
HICON GetIconFromFile(_In_ INT cx, _In_ INT cy, _In_ LPCWSTR pszFileName, _In_ INT iIcon)
@implemented
Definition: mlng.cpp:211
INT InatAddIcon(_In_ HICON hIcon)
@implemented
Definition: mlng.cpp:252
HICON InatCreateIcon(_In_ LANGID LangID)
@implemented
Definition: mlng.cpp:316
BOOL InatGetIconSize(_Out_ INT *pcx, _Out_ INT *pcy)
@implemented
Definition: mlng.cpp:334
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static HICON
Definition: imagelist.c:84
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define _Out_opt_
Definition: ms_sal.h:346
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
HICON hIcon
Definition: msconfig.c:44
HRESULT WINAPI TF_InitMlngInfo(void)
Definition: msctf.c:704
UINT_PTR HKL
Definition: msctf.idl:143
unsigned int UINT
Definition: ndis.h:50
#define UNICODE_NULL
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define INT
Definition: polytest.cpp:20
static const WCHAR szName[]
Definition: powrprof.c:45
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define _countof(array)
Definition: sndvol32.h:68
#define TRACE(s)
Definition: solgame.cpp:4
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
LONG lfHeight
Definition: dimm.idl:59
LONG lfWidth
Definition: dimm.idl:60
Definition: mlng.h:11
void InitDesc()
@implemented
Definition: mlng.cpp:370
void InitIcon()
@implemented
Definition: mlng.cpp:383
HKL m_hKL
Definition: mlng.h:12
void SetDesc(LPCWSTR pszDesc)
@implemented
Definition: mlng.cpp:423
INT GetIconIndex()
@implemented
Definition: mlng.cpp:429
BOOL m_bInitDesc
Definition: mlng.h:13
WCHAR m_szDesc[128]
Definition: mlng.h:16
BOOL m_bInitIcon
Definition: mlng.h:14
INT m_iIconIndex
Definition: mlng.h:15
LPCWSTR GetDesc()
@implemented
Definition: mlng.cpp:414
Definition: time.h:68
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
int ret
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1083
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define WINAPI
Definition: msvc.h:6
#define BLACKNESS
Definition: wingdi.h:323
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
#define ETO_OPAQUE
Definition: wingdi.h:647
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
BOOL WINAPI DeleteDC(_In_ HDC)
#define LOCALE_SLANGUAGE
Definition: winnls.h:26
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
#define LOCALE_SABBREVLANGNAME
Definition: winnls.h:28
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2612
#define DT_CENTER
Definition: winuser.h:527
#define COLOR_HIGHLIGHT
Definition: winuser.h:926
#define DT_SINGLELINE
Definition: winuser.h:540
HICON WINAPI CopyIcon(_In_ HICON)
Definition: cursoricon.c:2042
#define SM_CYSMICON
Definition: winuser.h:1013
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1380
#define SM_CXSMICON
Definition: winuser.h:1012
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:927
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define DT_VCENTER
Definition: winuser.h:543
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2084
LPWSTR WINAPI CharUpperW(_Inout_ LPWSTR)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185