30#define WM_NOTIFYICONMSG (WM_USER + 248)
64 TEXT(
"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts"),
70 for (dwIndex = 0; dwIndex < 1000; ++dwIndex)
79 dwSize =
sizeof(szLayoutId);
150 for (iKL = 0; iKL <
g_cKLs; ++iKL)
168 if (0 <= (nLayoutNum - 1) && (nLayoutNum - 1) <
g_cKLs)
170 return g_ahKLs[nLayoutNum - 1];
208 _T(
"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\%s"), szKLID);
245 if (szKLID[0] !=
TEXT(
'E') && szKLID[0] !=
TEXT(
'e'))
249 _T(
"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\%s"), szKLID);
283 if (pLoadIcon->
hIcon)
327 HBITMAP hbmColor, hbmMono, hBmpOld;
337 if (szImeFile && szImeFile[0])
350 szBuf[0] = szBuf[1] =
_T(
'?');
362 if (!
hdc || !hbmColor || !hbmMono)
486 if (uLayoutNum == 0 || uLayoutNum > 0xFF)
496 if (hwndTarget && !bNoActivate)
507 INPUTLANGCHANGE_SYSCHARSET, (
LPARAM)hKl);
526 for (iKL = 0; iKL <
g_cKLs; ++iKL)
594 for (iKL = 0; iKL <
g_cKLs; ++iKL)
629 HWND hwndTarget = hwndFore;
630 if (hwndTarget ==
NULL)
638 return (hwndIME ? hwndIME : hwndTarget);
681 static UINT s_uTaskbarRestart;
683 HMENU hLeftPopupMenu;
741 if (!s_hRightPopupMenu)
768 TEXT(
"control.exe"),
TEXT(
"input.dll"),
784 if (hwndTarget ==
NULL)
793 hwndTargetSave = hwndTarget;
832 if (
wParam == SPI_SETNONCLIENTMETRICS)
851 if (
Message == s_uTaskbarRestart)
859 if (
wParam == HSHELL_LANGUAGE)
861 else if (
wParam == HSHELL_WINDOWACTIVATED)
914 hwnd =
CreateWindow(
szKbSwitcherName,
NULL, 0, 0, 0, 1, 1,
HWND_DESKTOP,
NULL,
hInstance,
NULL);
#define RegCloseKey(hKey)
#define GetProcAddress(x, y)
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
LANGID WINAPI GetUserDefaultUILanguage(void)
static const WCHAR Message[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void WINAPI SHIM_OBJ_NAME() OutputDebugStringA(LPCSTR lpOutputString)
#define IS_SPECIAL_HKL(hKL)
_Out_opt_ PICONINFO IconInfo
static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
static VOID LoadSpecialIds(VOID)
static HBITMAP BitmapFromIcon(HICON hIcon)
PKBSWITCHSETHOOKS KbSwitchSetHooks
struct tagLOAD_ICON LOAD_ICON
static VOID UpdateTrayIcon(HWND hwnd, LPTSTR szKLID, LPTSTR szName)
struct SPECIAL_ID * PSPECIAL_ID
static HICON FakeExtractIcon(LPCTSTR szIconPath, INT cxIcon, INT cyIcon)
static BOOL GetLayoutName(INT nLayoutNum, LPTSTR szName, SIZE_T NameLength)
static VOID GetKLIDFromHKL(HKL hKL, LPTSTR szKLID, SIZE_T KLIDLength)
static UINT GetLayoutNum(HKL hKL)
SPECIAL_ID g_SpecialIds[80]
static HICON CreateTrayIcon(LPTSTR szKLID, LPCTSTR szImeFile OPTIONAL)
static HKL GetHKLFromLayoutNum(INT nLayoutNum)
LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
static HMENU BuildLeftPopupMenu(VOID)
static BOOL RememberLastActive(HWND hwnd, HWND hwndFore)
PKBSWITCHDELETEHOOKS KbSwitchDeleteHooks
static VOID UpdateLayoutList(HKL hKL OPTIONAL)
static VOID ActivateLayout(HWND hwnd, ULONG uLayoutNum, HWND hwndTarget OPTIONAL, BOOL bNoActivate)
ULONG GetNextLayout(VOID)
static BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LPARAM lParam)
static VOID GetKLIDFromLayoutNum(INT nLayoutNum, LPTSTR szKLID, SIZE_T KLIDLength)
UINT UpdateLanguageDisplay(HWND hwnd, HKL hKL)
static BOOL GetImeFile(LPTSTR szImeFile, SIZE_T cchImeFile, LPCTSTR szKLID)
UINT UpdateLanguageDisplayCurrent(HWND hwnd, HWND hwndFore)
struct tagLOAD_ICON * PLOAD_ICON
static BOOL GetSystemLibraryPath(LPTSTR szPath, SIZE_T cchPath, LPCTSTR FileName)
static VOID AddTrayIcon(HWND hwnd)
static VOID DeleteTrayIcon(HWND hwnd)
HWND GetTargetWindow(HWND hwndFore)
BOOL(WINAPI * PKBSWITCHSETHOOKS)(VOID)
#define WM_WINDOW_ACTIVATE
VOID(WINAPI * PKBSWITCHDELETEHOOKS)(VOID)
#define ERROR_ALREADY_EXISTS
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static const WCHAR szName[]
#define LANGIDFROMLCID(l)
#define SHLoadRegUIString
PULONG MinorVersion OPTIONAL
TW_UINT32 TW_UINT16 TW_UINT16 MSG
_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
COLORREF WINAPI SetDCBrushColor(_In_ HDC hdc, _In_ COLORREF crColor)
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
#define GetSystemDirectory
DWORD WINAPI GetLastError(void)
#define LOAD_LIBRARY_AS_DATAFILE
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define EnumResourceNames
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_ DWORD _In_ DWORD dwBufLen
HGDIOBJ WINAPI GetStockObject(_In_ int)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
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)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
#define CreateFontIndirect
#define LOCALE_NOUSEROVERRIDE
#define LOCALE_SABBREVLANGNAME
#define HKEY_LOCAL_MACHINE
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
HMENU WINAPI CreatePopupMenu(void)
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define KLF_SETFORPROCESS
HWND WINAPI GetForegroundWindow(void)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
BOOL WINAPI RegisterShellHookWindow(_In_ HWND)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
#define LoadKeyboardLayout
#define SPI_GETICONTITLELOGFONT
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
#define RegisterWindowMessage
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
#define COLOR_HIGHLIGHTTEXT
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
HKL WINAPI ActivateKeyboardLayout(_In_ HKL, _In_ UINT)
#define SystemParametersInfo
BOOL WINAPI IsWindowVisible(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)