16#define IMM_INIT_MAGIC 0x19650412
17#define MAX_CANDIDATEFORM 4
41#undef DEFINE_IMM_ENTRY
42#define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
43 static type WINAPI IMMSTUB_##name params { IMM_RETURN_##retkind((type)retval); }
49#undef DEFINE_IMM_ENTRY
50#define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
80 TRACE(
"File %S\n", ImmFile);
96 ERR(
"Did not load imm32.dll!\n");
103#undef DEFINE_IMM_ENTRY
104#define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
106 FN_##name proc = (FN_##name)GetProcAddress(imm32, #name); \
108 ERR("Could not load %s\n", #name); \
111 IMM_FN(name) = proc; \
146 ERR(
"Did not load imm32.dll!\n");
178 pwnd = pimeui->
spwnd;
217 if (!pIMC || pIMC->
hImeWnd == hImeWnd)
232 if (hNewIMC == hOldIMC)
238 pimeui->
hIMC = hNewIMC;
251 HWND hwndUI, hwndIMC, hImeWnd, hwndOwner;
327 szUIClass[
_countof(szUIClass) - 1] = 0;
354 hIMC = pParentWnd->
hImc;
430 DWORD dwConversion, dwSentence;
630 DWORD dwConversion, dwSentence;
685 pCandForm = &pIC->cfCandForm[
lParam];
704 pCompForm = &pIC->cfCompForm;
784 HWND hwndFocus, hwndOldImc, hwndNewImc, hImeWnd, hwndActive, hwndOwner;
785 PWND pwndFocus, pImeWnd, pwndOwner;
842 if (hwndFocus != pIC->hWnd)
848 if ((pIC->
dwUIFlags & 0x40000) && hwndOldImc != hwndFocus)
886 if (pwndFocus && pImeWnd && pImeWnd->
head.pti == pwndFocus->
head.pti)
891 if (hwndOldImc && hwndNewImc && hwndOldImc != hwndNewImc &&
905 pImeWnd = pimeui->
spwnd;
912 pImeWnd = pimeui->
spwnd;
915 if (!pwndFocus || !hwndActive || pImeWnd->
head.pti != pwndFocus->
head.pti)
954 ERR(
"fnid was 0x%x\n", pWnd->
fnid);
964 ERR(
"HeapAlloc failed\n");
971 pimeui->spwnd = pWnd;
991 case WM_IME_STARTCOMPOSITION:
992 case WM_IME_COMPOSITION:
993 case WM_IME_ENDCOMPOSITION:
1055 case WM_IME_STARTCOMPOSITION:
1056 case WM_IME_COMPOSITION:
1057 case WM_IME_ENDCOMPOSITION:
1118 ERR(
"Imm32 not installed!\n");
1141 ERR(
"Failed to register IME Class!\n");
1146 TRACE(
"RegisterIMEClass atom = %u\n", atom);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
BOOL WINAPI ImmSetCandidateWindow(HIMC hIMC, LPCANDIDATEFORM lpCandidate)
BOOL WINAPI ImmGetCandidateWindow(HIMC hIMC, DWORD dwIndex, LPCANDIDATEFORM lpCandidate)
VOID WINAPI CtfImmRestoreToolbarWnd(_In_ LPVOID pUnused, _In_ DWORD dwShowFlags)
LRESULT WINAPI CtfImmDispatchDefImeMessage(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam)
HRESULT WINAPI CtfImmTIMActivate(_In_ HKL hKL)
DWORD WINAPI CtfImmHideToolbarWnd(VOID)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
#define HeapFree(x, y, z)
#define WideCharToMultiByte
BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
BOOL WINAPI ImmConfigureIMEW(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
LRESULT WINAPI ImmEscapeW(HKL hKL, HIMC hIMC, UINT uSubFunc, LPVOID lpData)
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
LRESULT WINAPI ImmPutImeMenuItemsIntoMappedFile(HIMC hIMC)
BOOL WINAPI ImmWINNLSEnableIME(HWND hWnd, BOOL enable)
BOOL WINAPI ImmGetConversionStatus(HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
BOOL WINAPI ImmLoadIME(HKL hKL)
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
HIMC WINAPI ImmGetContext(HWND hWnd)
BOOL WINAPI User32InitializeImmEntryTable(DWORD)
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
BOOL WINAPI ImmRegisterClient(PSHAREDINFO ptr, HINSTANCE hMod)
BOOL WINAPI ImmFreeLayout(HKL hKL)
BOOL WINAPI ImmActivateLayout(HKL hKL)
BOOL WINAPI ImmWINNLSGetEnableStatus(HWND hWnd)
#define ValidateHwnd(hwnd)
#define MAX_CANDIDATEFORM
LPVOID FASTCALL ValidateHandle(HANDLE hObject, UINT uType)
BOOL WINAPI ImmIMPQueryIMEA(LPIMEPROA pImePro)
BOOL WINAPI ImmIMPGetIMEW(HWND hWnd, LPIMEPROW pImePro)
BOOL WINAPI ImmIMPGetIMEA(HWND hWnd, LPIMEPROA pImePro)
BOOL WINAPI ImmIMPSetIMEA(HWND hWnd, LPIMEPROA pImePro)
BOOL WINAPI ImmIMPQueryIMEW(LPIMEPROW pImePro)
BOOL WINAPI ImmIMPSetIMEW(HWND hWnd, LPIMEPROW pImePro)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
GLuint GLsizei GLsizei * length
@ ImeInfoExKeyboardLayout
#define IMC_SETCANDIDATEPOS
#define IMC_CLOSESTATUSWINDOW
#define IME_ESC_QUERY_SUPPORT
#define IMC_SETSTATUSWINDOWPOS
#define IMC_GETCOMPOSITIONWINDOW
#define IMC_SETCOMPOSITIONWINDOW
#define IMC_GETCANDIDATEPOS
#define IME_ESC_GETHELPFILENAME
#define IMN_OPENSTATUSWINDOW
#define IMC_GETCOMPOSITIONFONT
#define IMC_SETCOMPOSITIONFONT
#define IMN_SETOPENSTATUS
#define IMC_OPENSTATUSWINDOW
#define IMN_CLOSESTATUSWINDOW
#define IMC_GETSTATUSWINDOWPOS
#define IMN_SETCONVERSIONMODE
#define IME_CONFIG_GENERAL
#define IMC_SETOPENSTATUS
#define IMS_SETOPENSTATUS
#define IMC_SETCONVERSIONMODE
#define IMC_SETSENTENCEMODE
#define IMC_GETSOFTKBDPOS
#define IMS_COMPLETECOMPSTR
#define IMS_UNSETLANGBAND
#define IMS_GETCONVSTATUS
#define IMS_NOTIFYIMESHOW
#define IMS_LOADTHREADLAYOUT
#define IMC_GETSENTENCEMODE
#define IMS_ACTIVATELAYOUT
#define IMC_GETOPENSTATUS
#define IMS_IMEDEACTIVATE
#define IMC_SETSOFTKBDPOS
#define IMS_SENDNOTIFICATION
#define IMC_GETCONVERSIONMODE
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ICLASS_TO_MASK(iCls)
#define QUERY_WINDOW_FOCUS
#define QUERY_WINDOW_ACTIVE
#define UserHMGetHandle(obj)
DWORD_PTR NTAPI NtUserCallNoParam(DWORD Routine)
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
DWORD NTAPI NtUserCallHwndParamLock(HWND hWnd, DWORD_PTR Param, DWORD Routine)
#define NtUserSetWindowLongPtr
BOOL NTAPI NtUserSetImeOwnerWindow(HWND hImeWnd, HWND hwndFocus)
@ THREADSTATE_CHECKCONIME
BOOLEAN NTAPI NtUserDestroyWindow(HWND Wnd)
@ NOPARAM_ROUTINE_GETIMESHOWSTATUS
@ HWNDLOCK_ROUTINE_CHECKIMESHOWSTATUSINTHRD
@ NOPARAM_ROUTINE_UPDATEPERUSERIMMENABLING
@ TWOPARAM_ROUTINE_IMESHOWSTATUSCHANGE
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
BOOL NTAPI NtUserCallHwndLock(HWND hWnd, DWORD Routine)
BOOL NTAPI NtUserUpdateInputContext(HIMC hIMC, DWORD dwType, DWORD_PTR dwValue)
#define GetWin32ClientInfo()
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
LRESULT WINAPI ImmSystemHandler(HIMC hIMC, WPARAM wParam, LPARAM lParam)
static DWORD DWORD void LPSTR DWORD cch
DWORD RegisterDefaultClasses
ATOM WINAPI RegisterClassExWOWW(WNDCLASSEXW *, LPDWORD, WORD, DWORD, BOOL)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
#define RtlZeroMemory(Destination, Length)
static VOID User32SetImeWindowOfImc(HIMC hIMC, HWND hImeWnd)
BOOL WINAPI IMPSetIMEW(HWND hwnd, LPIMEPROW ime)
static VOID User32DestroyImeUIWindow(PIMEUI pimeui)
BOOL WINAPI IMPQueryIMEA(LPIMEPROA ime)
UINT WINAPI WINNLSGetIMEHotkey(HWND hwnd)
Imm32ApiTable gImmApiEntries
LRESULT WINAPI ImeWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
BOOL WINAPI IMPQueryIMEW(LPIMEPROW ime)
HRESULT User32GetImmFileName(_Out_ LPWSTR lpBuffer, _In_ size_t cchBuffer)
static BOOL User32GetImeShowStatus(VOID)
LRESULT ImeWnd_OnImeSetContext(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
static INT ImeWnd_OnCreate(PIMEUI pimeui, LPCREATESTRUCT lpCS)
static VOID FASTCALL User32SetImeActivenessOfWindow(HWND hWnd, BOOL bActive)
static HWND User32CreateImeUIWindow(PIMEUI pimeui, HKL hKL)
LRESULT WINAPI SendIMEMessageExA(HWND hwnd, LPARAM lParam)
static BOOL IntInitializeImmEntryTable(VOID)
static LRESULT User32SendImeUIMessage(PIMEUI pimeui, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
LRESULT WINAPI ImeWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
BOOL WINAPI UpdatePerUserImmEnabling(VOID)
BOOL WINAPI InitializeImmEntryTable(VOID)
static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
VOID FASTCALL CtfLoadThreadLayout(PIMEUI pimeui)
static LRESULT ImeWnd_OnImeControl(PIMEUI pimeui, WPARAM wParam, LPARAM lParam, BOOL unicode)
BOOL WINAPI IMPGetIMEA(HWND hwnd, LPIMEPROA ime)
static BOOL User32CanSetImeWindowToImc(HIMC hIMC, HWND hImeWnd)
BOOL WINAPI IMPSetIMEA(HWND hwnd, LPIMEPROA ime)
BOOL WINAPI WINNLSEnableIME(HWND hwnd, BOOL enable)
BOOL WINAPI RegisterIMEClass(VOID)
HWND FASTCALL IntGetTopLevelWindow(HWND hWnd)
static VOID ImeWnd_OnImeSelect(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
BOOL WINAPI IMPGetIMEW(HWND hwnd, LPIMEPROW ime)
static VOID User32UpdateImcOfImeUI(PIMEUI pimeui, HIMC hNewIMC)
static LRESULT ImeWnd_OnImeNotify(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
static VOID User32NotifyOpenStatus(PIMEUI pimeui, HWND hwndIMC, BOOL bOpen)
static LRESULT FASTCALL User32DoImeHelp(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
LRESULT WINAPI SendIMEMessageExW(HWND hwnd, LPARAM lParam)
LRESULT WINAPI ImeWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
BOOL WINAPI WINNLSGetEnableStatus(HWND hwnd)
WORD WINAPI ImmSendIMEMessageExW(HWND hWnd, LPARAM lParam)
WORD WINAPI ImmSendIMEMessageExA(HWND hWnd, LPARAM lParam)
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define GetWindowLongPtrW
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define WM_IME_SETCONTEXT
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
#define WM_IME_COMPOSITIONFULL
HWND WINAPI GetParent(_In_ HWND)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
BOOL WINAPI GetClassInfoW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSW)
#define SetWindowLongPtrW
BOOL WINAPI DestroyWindow(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)