imm32: Implement ImmUnregisterWord using loaded IME.

This commit is contained in:
Aric Stewart 2008-04-09 09:42:29 -05:00 committed by Alexandre Julliard
parent 25cb21de44
commit 5ce9649f5a
1 changed files with 44 additions and 10 deletions

View File

@ -1805,10 +1805,27 @@ BOOL WINAPI ImmSimulateHotKey(HWND hWnd, DWORD dwHotKeyID)
BOOL WINAPI ImmUnregisterWordA(
HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszUnregister)
{
FIXME("(%p, %s, %d, %s): stub\n",
hKL, debugstr_a(lpszReading), dwStyle, debugstr_a(lpszUnregister)
);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
ImmHkl *immHkl = IMM_GetImmHkl(hKL);
TRACE("(%p, %s, %d, %s):\n", hKL, debugstr_a(lpszReading), dwStyle,
debugstr_a(lpszUnregister));
if (immHkl->hIME && immHkl->pImeUnregisterWord)
{
if (!is_kbd_ime_unicode(immHkl))
return immHkl->pImeUnregisterWord((LPCWSTR)lpszReading,dwStyle,
(LPCWSTR)lpszUnregister);
else
{
LPWSTR lpszwReading = strdupAtoW(lpszReading);
LPWSTR lpszwUnregister = strdupAtoW(lpszUnregister);
BOOL rc;
rc = immHkl->pImeUnregisterWord(lpszwReading,dwStyle,lpszwUnregister);
HeapFree(GetProcessHeap(),0,lpszwReading);
HeapFree(GetProcessHeap(),0,lpszwUnregister);
return rc;
}
}
else
return FALSE;
}
@ -1818,10 +1835,27 @@ BOOL WINAPI ImmUnregisterWordA(
BOOL WINAPI ImmUnregisterWordW(
HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszUnregister)
{
FIXME("(%p, %s, %d, %s): stub\n",
hKL, debugstr_w(lpszReading), dwStyle, debugstr_w(lpszUnregister)
);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
ImmHkl *immHkl = IMM_GetImmHkl(hKL);
TRACE("(%p, %s, %d, %s):\n", hKL, debugstr_w(lpszReading), dwStyle,
debugstr_w(lpszUnregister));
if (immHkl->hIME && immHkl->pImeUnregisterWord)
{
if (is_kbd_ime_unicode(immHkl))
return immHkl->pImeUnregisterWord(lpszReading,dwStyle,lpszUnregister);
else
{
LPSTR lpszaReading = strdupWtoA(lpszReading);
LPSTR lpszaUnregister = strdupWtoA(lpszUnregister);
BOOL rc;
rc = immHkl->pImeUnregisterWord((LPCWSTR)lpszaReading,dwStyle,
(LPCWSTR)lpszaUnregister);
HeapFree(GetProcessHeap(),0,lpszaReading);
HeapFree(GetProcessHeap(),0,lpszaUnregister);
return rc;
}
}
else
return FALSE;
}