[IMM32] Implement ImmWINNLSGetEnableStatus

CORE-11700
This commit is contained in:
Katayama Hirofumi MZ 2022-02-10 15:18:44 +09:00
parent cf32c7cb5e
commit 8cdfc245b3
4 changed files with 26 additions and 2 deletions

View file

@ -1176,7 +1176,7 @@ BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
}
else
{
hIMC = Imm32GetContextEx(hWnd, TRUE);
hIMC = Imm32GetContextEx(hWnd, 1);
pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
if (pIC)
{
@ -1221,6 +1221,21 @@ BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
return TRUE;
}
/***********************************************************************
* ImmWINNLSGetEnableStatus (IMM32.@)
*/
BOOL WINAPI ImmWINNLSGetEnableStatus(HWND hWnd)
{
if (!Imm32IsSystemJapaneseOrKorean())
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
return !!Imm32GetContextEx(hWnd, 2);
}
/***********************************************************************
* ImmSetActiveContextConsoleIME(IMM32.@)
*/

View file

@ -115,5 +115,5 @@
@ stdcall ImmUnregisterWordA(long str long str)
@ stdcall ImmUnregisterWordW(long wstr long wstr)
@ stdcall -stub ImmWINNLSEnableIME(ptr long)
@ stdcall -stub ImmWINNLSGetEnableStatus(ptr)
@ stdcall ImmWINNLSGetEnableStatus(ptr)
@ stdcall ImmWINNLSGetIMEHotkey(ptr)

View file

@ -94,6 +94,7 @@ LONG APIENTRY IchAnsiFromWide(LONG cchWide, LPCWSTR pchWide, UINT uCodePage);
PIMEDPI APIENTRY ImmLockOrLoadImeDpi(HKL hKL);
LPINPUTCONTEXT APIENTRY Imm32LockIMCEx(HIMC hIMC, BOOL fSelect);
BOOL APIENTRY Imm32ReleaseIME(HKL hKL);
BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID);
static inline BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
{

View file

@ -41,6 +41,14 @@ Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT cchBuff)
return S_OK;
}
BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID)
{
LCID lcid = GetSystemDefaultLCID();
LANGID LangID = LANGIDFROMLCID(lcid);
WORD wPrimary = PRIMARYLANGID(LangID);
return (wPrimary == LANG_JAPANESE || wPrimary == LANG_KOREAN);
}
BOOL WINAPI Imm32IsImcAnsi(HIMC hIMC)
{
BOOL ret;