4 * Copyright 1998 Patrik Stridvall
5 * Copyright 2002 Codeweavers, Aric Stewart
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(imm);
35 typedef struct tagInputContextData
37 LPBYTE CompositionString;
38 LPBYTE CompositionReadingString;
40 LPBYTE ResultReadingString;
41 DWORD dwCompStringSize;
42 DWORD dwCompReadStringSize;
43 DWORD dwResultStringSize;
44 DWORD dwResultReadStringSize;
50 static InputContextData *root_context = NULL;
51 static HWND hwndDefault = NULL;
52 static HANDLE hImeInst;
53 static const WCHAR WC_IMECLASSNAME[] = {'W','i','n','e','I','M','E','C','l','a','s','s',0};
55 static LRESULT CALLBACK IME_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
57 static VOID IMM_PostResult(InputContextData *data)
61 for (i = 0; i < data->dwResultStringSize / sizeof (WCHAR); i++)
62 SendMessageW(data->hwnd, WM_IME_CHAR, ((WCHAR*)data->ResultString)[i], 1);
65 static void IMM_Register(void)
68 ZeroMemory(&wndClass, sizeof(WNDCLASSW));
69 wndClass.style = CS_GLOBALCLASS | CS_IME;
70 wndClass.lpfnWndProc = IME_WindowProc;
71 wndClass.cbClsExtra = 0;
72 wndClass.cbWndExtra = 0;
73 wndClass.hCursor = NULL;
74 wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW +1);
75 wndClass.lpszClassName = WC_IMECLASSNAME;
76 RegisterClassW(&wndClass);
79 static void IMM_Unregister(void)
81 UnregisterClassW(WC_IMECLASSNAME, NULL);
85 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
87 TRACE("%p, %lx, %p\n",hInstDLL,fdwReason,lpReserved);
90 case DLL_PROCESS_ATTACH:
91 DisableThreadLibraryCalls(hInstDLL);
94 case DLL_PROCESS_DETACH:
97 DestroyWindow(hwndDefault);
107 /***********************************************************************
108 * ImmAssociateContext (IMM32.@)
110 HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
112 InputContextData *data = (InputContextData*)hIMC;
114 FIXME("(%p, %p): semi-stub\n",hWnd,hIMC);
120 * WINE SPECIFIC! MAY CONFLICT
121 * associate the root context we have an XIM created
125 root_context = (InputContextData*)hIMC;
129 * If already associated just return
131 if (data->hwnd == hWnd)
134 if (IsWindow(data->hwnd))
137 * Post a message that your context is switching
139 SendMessageW(data->hwnd, WM_IME_SETCONTEXT, FALSE, ISC_SHOWUIALL);
144 if (IsWindow(data->hwnd))
147 * Post a message that your context is switching
149 SendMessageW(data->hwnd, WM_IME_SETCONTEXT, TRUE, ISC_SHOWUIALL);
153 * TODO: We need to keep track of the old context associated
154 * with a window and return it for now we will return NULL;
159 /***********************************************************************
160 * ImmConfigureIMEA (IMM32.@)
162 BOOL WINAPI ImmConfigureIMEA(
163 HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
165 FIXME("(%p, %p, %ld, %p): stub\n",
166 hKL, hWnd, dwMode, lpData
168 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
172 /***********************************************************************
173 * ImmConfigureIMEW (IMM32.@)
175 BOOL WINAPI ImmConfigureIMEW(
176 HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
178 FIXME("(%p, %p, %ld, %p): stub\n",
179 hKL, hWnd, dwMode, lpData
181 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
185 /***********************************************************************
186 * ImmCreateContext (IMM32.@)
188 HIMC WINAPI ImmCreateContext(void)
190 InputContextData *new_context;
192 new_context = HeapAlloc(GetProcessHeap(),0,sizeof(InputContextData));
193 ZeroMemory(new_context,sizeof(InputContextData));
195 return (HIMC)new_context;
198 /***********************************************************************
199 * ImmDestroyContext (IMM32.@)
201 BOOL WINAPI ImmDestroyContext(HIMC hIMC)
203 InputContextData *data = (InputContextData*)hIMC;
205 TRACE("Destroying %p\n",hIMC);
209 if (data->dwCompStringSize)
210 HeapFree(GetProcessHeap(),0,data->CompositionString);
211 if (data->dwCompReadStringSize)
212 HeapFree(GetProcessHeap(),0,data->CompositionReadingString);
213 if (data->dwResultStringSize)
214 HeapFree(GetProcessHeap(),0,data->ResultString);
215 if (data->dwResultReadStringSize)
216 HeapFree(GetProcessHeap(),0,data->ResultReadingString);
218 HeapFree(GetProcessHeap(),0,data);
223 /***********************************************************************
224 * ImmEnumRegisterWordA (IMM32.@)
226 UINT WINAPI ImmEnumRegisterWordA(
227 HKL hKL, REGISTERWORDENUMPROCA lpfnEnumProc,
228 LPCSTR lpszReading, DWORD dwStyle,
229 LPCSTR lpszRegister, LPVOID lpData)
231 FIXME("(%p, %p, %s, %ld, %s, %p): stub\n",
233 debugstr_a(lpszReading), dwStyle,
234 debugstr_a(lpszRegister), lpData
236 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
240 /***********************************************************************
241 * ImmEnumRegisterWordW (IMM32.@)
243 UINT WINAPI ImmEnumRegisterWordW(
244 HKL hKL, REGISTERWORDENUMPROCW lpfnEnumProc,
245 LPCWSTR lpszReading, DWORD dwStyle,
246 LPCWSTR lpszRegister, LPVOID lpData)
248 FIXME("(%p, %p, %s, %ld, %s, %p): stub\n",
250 debugstr_w(lpszReading), dwStyle,
251 debugstr_w(lpszRegister), lpData
253 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
257 /***********************************************************************
258 * ImmEscapeA (IMM32.@)
260 LRESULT WINAPI ImmEscapeA(
262 UINT uEscape, LPVOID lpData)
264 FIXME("(%p, %p, %d, %p): stub\n",
265 hKL, hIMC, uEscape, lpData
267 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
271 /***********************************************************************
272 * ImmEscapeW (IMM32.@)
274 LRESULT WINAPI ImmEscapeW(
276 UINT uEscape, LPVOID lpData)
278 FIXME("(%p, %p, %d, %p): stub\n",
279 hKL, hIMC, uEscape, lpData
281 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
285 /***********************************************************************
286 * ImmGetCandidateListA (IMM32.@)
288 DWORD WINAPI ImmGetCandidateListA(
289 HIMC hIMC, DWORD deIndex,
290 LPCANDIDATELIST lpCandList, DWORD dwBufLen)
292 FIXME("(%p, %ld, %p, %ld): stub\n",
296 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
300 /***********************************************************************
301 * ImmGetCandidateListCountA (IMM32.@)
303 DWORD WINAPI ImmGetCandidateListCountA(
304 HIMC hIMC, LPDWORD lpdwListCount)
306 FIXME("(%p, %p): stub\n", hIMC, lpdwListCount);
307 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
311 /***********************************************************************
312 * ImmGetCandidateListCountW (IMM32.@)
314 DWORD WINAPI ImmGetCandidateListCountW(
315 HIMC hIMC, LPDWORD lpdwListCount)
317 FIXME("(%p, %p): stub\n", hIMC, lpdwListCount);
318 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
322 /***********************************************************************
323 * ImmGetCandidateListW (IMM32.@)
325 DWORD WINAPI ImmGetCandidateListW(
326 HIMC hIMC, DWORD deIndex,
327 LPCANDIDATELIST lpCandList, DWORD dwBufLen)
329 FIXME("(%p, %ld, %p, %ld): stub\n",
333 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
337 /***********************************************************************
338 * ImmGetCandidateWindow (IMM32.@)
340 BOOL WINAPI ImmGetCandidateWindow(
341 HIMC hIMC, DWORD dwBufLen, LPCANDIDATEFORM lpCandidate)
343 FIXME("(%p, %ld, %p): stub\n", hIMC, dwBufLen, lpCandidate);
344 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
348 /***********************************************************************
349 * ImmGetCompositionFontA (IMM32.@)
351 BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
353 FIXME("(%p, %p): stub\n", hIMC, lplf);
354 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
358 /***********************************************************************
359 * ImmGetCompositionFontW (IMM32.@)
361 BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
363 FIXME("(%p, %p): stub\n", hIMC, lplf);
364 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
368 /***********************************************************************
369 * ImmGetCompositionStringA (IMM32.@)
371 LONG WINAPI ImmGetCompositionStringA(
372 HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
375 LPBYTE wcstring=NULL;
377 FIXME("(%p, %ld, %p, %ld): stub\n",
378 hIMC, dwIndex, lpBuf, dwBufLen);
381 wcstring = HeapAlloc(GetProcessHeap(),0,dwBufLen * 2);
383 rc = ImmGetCompositionStringW(hIMC, dwIndex, wcstring, dwBufLen*2 );
385 if ((rc > dwBufLen) || (rc == 0))
388 HeapFree(GetProcessHeap(),0,wcstring);
393 rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)wcstring, (rc / sizeof(WCHAR)),
394 lpBuf, dwBufLen, NULL, NULL);
396 HeapFree(GetProcessHeap(),0,wcstring);
401 /***********************************************************************
402 * ImmGetCompositionStringW (IMM32.@)
404 LONG WINAPI ImmGetCompositionStringW(
405 HIMC hIMC, DWORD dwIndex,
406 LPVOID lpBuf, DWORD dwBufLen)
408 InputContextData *data = (InputContextData*)hIMC;
410 FIXME("(%p, 0x%lx, %p, %ld): stub\n",
411 hIMC, dwIndex, lpBuf, dwBufLen
417 if (dwIndex == GCS_RESULTSTR)
421 if (dwBufLen >= data->dwResultStringSize)
422 memcpy(lpBuf,data->ResultString,data->dwResultStringSize);
424 return data->dwResultStringSize;
427 if (dwIndex == GCS_RESULTREADSTR)
429 if (dwBufLen >= data->dwResultReadStringSize)
430 memcpy(lpBuf,data->ResultReadingString,
431 data->dwResultReadStringSize);
433 return data->dwResultReadStringSize;
436 if (dwIndex == GCS_COMPSTR)
438 if (dwBufLen >= data->dwCompStringSize)
439 memcpy(lpBuf,data->CompositionString,data->dwCompStringSize);
441 return data->dwCompStringSize;
444 if (dwIndex == GCS_COMPREADSTR)
446 if (dwBufLen >= data->dwCompReadStringSize)
447 memcpy(lpBuf,data->CompositionReadingString,
448 data->dwCompReadStringSize);
450 return data->dwCompReadStringSize;
456 /***********************************************************************
457 * ImmGetCompositionWindow (IMM32.@)
459 BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
461 FIXME("(%p, %p): stub\n", hIMC, lpCompForm);
462 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
466 /***********************************************************************
467 * ImmGetContext (IMM32.@)
469 HIMC WINAPI ImmGetContext(HWND hWnd)
471 FIXME("(%p): stub\n", hWnd);
472 return (HIMC)root_context;
475 /***********************************************************************
476 * ImmGetConversionListA (IMM32.@)
478 DWORD WINAPI ImmGetConversionListA(
480 LPCSTR pSrc, LPCANDIDATELIST lpDst,
481 DWORD dwBufLen, UINT uFlag)
483 FIXME("(%p, %p, %s, %p, %ld, %d): stub\n",
484 hKL, hIMC, debugstr_a(pSrc), lpDst, dwBufLen, uFlag
486 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
490 /***********************************************************************
491 * ImmGetConversionListW (IMM32.@)
493 DWORD WINAPI ImmGetConversionListW(
495 LPCWSTR pSrc, LPCANDIDATELIST lpDst,
496 DWORD dwBufLen, UINT uFlag)
498 FIXME("(%p, %p, %s, %p, %ld, %d): stub\n",
499 hKL, hIMC, debugstr_w(pSrc), lpDst, dwBufLen, uFlag
501 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
505 /***********************************************************************
506 * ImmGetConversionStatus (IMM32.@)
508 BOOL WINAPI ImmGetConversionStatus(
509 HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
511 FIXME("(%p, %p, %p): stub\n",
512 hIMC, lpfdwConversion, lpfdwSentence
514 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
518 /***********************************************************************
519 * ImmGetDefaultIMEWnd (IMM32.@)
521 HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
523 FIXME("(%p): semi-stub\n", hWnd);
525 if ((!hwndDefault) && (root_context))
527 static const WCHAR name[] = {'I','M','E',0};
530 hwndDefault = CreateWindowW( WC_IMECLASSNAME,
531 name,WS_POPUPWINDOW,0,0,0,0,0,0,hImeInst,0);
534 return (HWND)hwndDefault;
537 /***********************************************************************
538 * ImmGetDescriptionA (IMM32.@)
540 UINT WINAPI ImmGetDescriptionA(
541 HKL hKL, LPSTR lpszDescription, UINT uBufLen)
543 FIXME("(%p, %s, %d): stub\n",
544 hKL, debugstr_a(lpszDescription), uBufLen
546 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
550 /***********************************************************************
551 * ImmGetDescriptionW (IMM32.@)
553 UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
555 FIXME("(%p, %s, %d): stub\n",
556 hKL, debugstr_w(lpszDescription), uBufLen
558 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
562 /***********************************************************************
563 * ImmGetGuideLineA (IMM32.@)
565 DWORD WINAPI ImmGetGuideLineA(
566 HIMC hIMC, DWORD dwIndex, LPSTR lpBuf, DWORD dwBufLen)
568 FIXME("(%p, %ld, %s, %ld): stub\n",
569 hIMC, dwIndex, debugstr_a(lpBuf), dwBufLen
571 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
575 /***********************************************************************
576 * ImmGetGuideLineW (IMM32.@)
578 DWORD WINAPI ImmGetGuideLineW(HIMC hIMC, DWORD dwIndex, LPWSTR lpBuf, DWORD dwBufLen)
580 FIXME("(%p, %ld, %s, %ld): stub\n",
581 hIMC, dwIndex, debugstr_w(lpBuf), dwBufLen
583 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
587 /***********************************************************************
588 * ImmGetIMEFileNameA (IMM32.@)
590 UINT WINAPI ImmGetIMEFileNameA(
591 HKL hKL, LPSTR lpszFileName, UINT uBufLen)
593 FIXME("(%p, %s, %d): stub\n",
594 hKL, debugstr_a(lpszFileName), uBufLen
596 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
600 /***********************************************************************
601 * ImmGetIMEFileNameW (IMM32.@)
603 UINT WINAPI ImmGetIMEFileNameW(
604 HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
606 FIXME("(%p, %s, %d): stub\n",
607 hKL, debugstr_w(lpszFileName), uBufLen
609 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
613 /***********************************************************************
614 * ImmGetOpenStatus (IMM32.@)
616 BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
618 InputContextData *data = (InputContextData*)hIMC;
620 FIXME("(%p): semi-stub\n", hIMC);
622 if (!data) return FALSE;
627 /***********************************************************************
628 * ImmGetProperty (IMM32.@)
630 DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex)
633 FIXME("(%p, %ld): semi-stub\n", hKL, fdwIndex);
638 rc = IME_PROP_UNICODE | IME_PROP_SPECIAL_UI;
641 rc = SCS_CAP_COMPSTR;
644 rc = SELECT_CAP_CONVERSION | SELECT_CAP_SENTENCE;
646 case IGP_GETIMEVERSION:
656 /***********************************************************************
657 * ImmGetRegisterWordStyleA (IMM32.@)
659 UINT WINAPI ImmGetRegisterWordStyleA(
660 HKL hKL, UINT nItem, LPSTYLEBUFA lpStyleBuf)
662 FIXME("(%p, %d, %p): stub\n", hKL, nItem, lpStyleBuf);
663 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
667 /***********************************************************************
668 * ImmGetRegisterWordStyleW (IMM32.@)
670 UINT WINAPI ImmGetRegisterWordStyleW(
671 HKL hKL, UINT nItem, LPSTYLEBUFW lpStyleBuf)
673 FIXME("(%p, %d, %p): stub\n", hKL, nItem, lpStyleBuf);
674 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
678 /***********************************************************************
679 * ImmGetStatusWindowPos (IMM32.@)
681 BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
683 FIXME("(%p, %p): stub\n", hIMC, lpptPos);
684 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
688 /***********************************************************************
689 * ImmGetVirtualKey (IMM32.@)
691 UINT WINAPI ImmGetVirtualKey(HWND hWnd)
693 OSVERSIONINFOA version;
694 FIXME("(%p): stub\n", hWnd);
695 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
696 GetVersionExA( &version );
697 switch(version.dwPlatformId)
699 case VER_PLATFORM_WIN32_WINDOWS:
700 return VK_PROCESSKEY;
701 case VER_PLATFORM_WIN32_NT:
704 FIXME("%ld not supported\n",version.dwPlatformId);
705 return VK_PROCESSKEY;
709 /***********************************************************************
710 * ImmInstallIMEA (IMM32.@)
712 HKL WINAPI ImmInstallIMEA(
713 LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
715 FIXME("(%s, %s): stub\n",
716 debugstr_a(lpszIMEFileName), debugstr_a(lpszLayoutText)
718 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
722 /***********************************************************************
723 * ImmInstallIMEW (IMM32.@)
725 HKL WINAPI ImmInstallIMEW(
726 LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
728 FIXME("(%s, %s): stub\n",
729 debugstr_w(lpszIMEFileName), debugstr_w(lpszLayoutText)
731 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
735 /***********************************************************************
738 BOOL WINAPI ImmIsIME(HKL hKL)
740 FIXME("(%p): semi-stub\n", hKL);
742 * Dead key locales will return TRUE here when they should not
743 * There is probibly a more proper way to check this.
745 return (root_context != NULL);
748 /***********************************************************************
749 * ImmIsUIMessageA (IMM32.@)
751 BOOL WINAPI ImmIsUIMessageA(
752 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
754 FIXME("(%p, %d, %d, %ld): stub\n",
755 hWndIME, msg, wParam, lParam
757 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
761 /***********************************************************************
762 * ImmIsUIMessageW (IMM32.@)
764 BOOL WINAPI ImmIsUIMessageW(
765 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
767 FIXME("(%p, %d, %d, %ld): stub\n",
768 hWndIME, msg, wParam, lParam
770 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
774 /***********************************************************************
775 * ImmNotifyIME (IMM32.@)
777 BOOL WINAPI ImmNotifyIME(
778 HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
780 FIXME("(%p, %ld, %ld, %ld): stub\n",
781 hIMC, dwAction, dwIndex, dwValue
783 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
787 /***********************************************************************
788 * ImmRegisterWordA (IMM32.@)
790 BOOL WINAPI ImmRegisterWordA(
791 HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszRegister)
793 FIXME("(%p, %s, %ld, %s): stub\n",
794 hKL, debugstr_a(lpszReading), dwStyle, debugstr_a(lpszRegister)
796 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
800 /***********************************************************************
801 * ImmRegisterWordW (IMM32.@)
803 BOOL WINAPI ImmRegisterWordW(
804 HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszRegister)
806 FIXME("(%p, %s, %ld, %s): stub\n",
807 hKL, debugstr_w(lpszReading), dwStyle, debugstr_w(lpszRegister)
809 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
813 /***********************************************************************
814 * ImmReleaseContext (IMM32.@)
816 BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
818 FIXME("(%p, %p): stub\n", hWnd, hIMC);
819 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
823 /***********************************************************************
824 * ImmSetCandidateWindow (IMM32.@)
826 BOOL WINAPI ImmSetCandidateWindow(
827 HIMC hIMC, LPCANDIDATEFORM lpCandidate)
829 FIXME("(%p, %p): stub\n", hIMC, lpCandidate);
830 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
834 /***********************************************************************
835 * ImmSetCompositionFontA (IMM32.@)
837 BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
839 FIXME("(%p, %p): stub\n", hIMC, lplf);
840 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
844 /***********************************************************************
845 * ImmSetCompositionFontW (IMM32.@)
847 BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
849 FIXME("(%p, %p): stub\n", hIMC, lplf);
850 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
854 /***********************************************************************
855 * ImmSetCompositionStringA (IMM32.@)
857 BOOL WINAPI ImmSetCompositionStringA(
858 HIMC hIMC, DWORD dwIndex,
859 LPCVOID lpComp, DWORD dwCompLen,
860 LPCVOID lpRead, DWORD dwReadLen)
862 FIXME("(%p, %ld, %p, %ld, %p, %ld): stub\n",
863 hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen
865 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
869 /***********************************************************************
870 * ImmSetCompositionStringW (IMM32.@)
872 BOOL WINAPI ImmSetCompositionStringW(
873 HIMC hIMC, DWORD dwIndex,
874 LPCVOID lpComp, DWORD dwCompLen,
875 LPCVOID lpRead, DWORD dwReadLen)
877 InputContextData *data = (InputContextData*)hIMC;
879 FIXME("(%p, %ld, %p, %ld, %p, %ld): semi-stub\n",
880 hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen
886 if ((dwIndex == SCS_SETSTR)&&(dwCompLen || dwReadLen))
887 SendMessageW(data->hwnd, WM_IME_STARTCOMPOSITION, 0, 0);
889 if (dwIndex == SCS_SETSTR)
894 if (lpComp && dwCompLen)
896 /* if (data->dwCompStringSize)
897 HeapFree(GetProcessHeap(),0,data->CompositionString);
898 data->dwCompStringSize = dwCompLen;
899 data->CompositionString = HeapAlloc(GetProcessHeap(),0,dwCompLen);
900 memcpy(data->CompositionString,lpComp,dwCompLen);
901 send_comp |= GCS_COMPSTR;
905 if (data->dwResultStringSize)
906 HeapFree(GetProcessHeap(),0,data->ResultString);
907 data->dwResultStringSize= dwCompLen;
908 data->ResultString= HeapAlloc(GetProcessHeap(),0,dwCompLen);
909 memcpy(data->ResultString,lpComp,dwCompLen);
910 send_comp |= GCS_RESULTSTR;
913 if (lpRead && dwReadLen)
915 if (data->dwCompReadStringSize)
916 HeapFree(GetProcessHeap(),0,data->CompositionReadingString);
917 data->dwCompReadStringSize= dwReadLen;
918 data->CompositionReadingString = HeapAlloc(GetProcessHeap(), 0,
920 memcpy(data->CompositionReadingString,lpRead,dwReadLen);
921 send_comp |= GCS_COMPREADSTR;
925 SendMessageW(data->hwnd, WM_IME_COMPOSITION, 0, send_comp);
927 SendMessageW(data->hwnd, WM_IME_ENDCOMPOSITION, 0, 0);
934 /***********************************************************************
935 * ImmSetCompositionWindow (IMM32.@)
937 BOOL WINAPI ImmSetCompositionWindow(
938 HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
940 FIXME("(%p, %p): stub\n", hIMC, lpCompForm);
941 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
945 /***********************************************************************
946 * ImmSetConversionStatus (IMM32.@)
948 BOOL WINAPI ImmSetConversionStatus(
949 HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
951 FIXME("(%p, %ld, %ld): stub\n",
952 hIMC, fdwConversion, fdwSentence
954 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
958 /***********************************************************************
959 * ImmSetOpenStatus (IMM32.@)
961 BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
963 InputContextData *data = (InputContextData*)hIMC;
964 FIXME("Semi-Stub\n");
968 SendMessageW(data->hwnd, WM_IME_NOTIFY, IMN_SETOPENSTATUS, 0);
975 /***********************************************************************
976 * ImmSetStatusWindowPos (IMM32.@)
978 BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
980 FIXME("(%p, %p): stub\n", hIMC, lpptPos);
981 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
985 /***********************************************************************
986 * ImmSimulateHotKey (IMM32.@)
988 BOOL WINAPI ImmSimulateHotKey(HWND hWnd, DWORD dwHotKeyID)
990 FIXME("(%p, %ld): stub\n", hWnd, dwHotKeyID);
991 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
995 /***********************************************************************
996 * ImmUnregisterWordA (IMM32.@)
998 BOOL WINAPI ImmUnregisterWordA(
999 HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszUnregister)
1001 FIXME("(%p, %s, %ld, %s): stub\n",
1002 hKL, debugstr_a(lpszReading), dwStyle, debugstr_a(lpszUnregister)
1004 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1008 /***********************************************************************
1009 * ImmUnregisterWordW (IMM32.@)
1011 BOOL WINAPI ImmUnregisterWordW(
1012 HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszUnregister)
1014 FIXME("(%p, %s, %ld, %s): stub\n",
1015 hKL, debugstr_w(lpszReading), dwStyle, debugstr_w(lpszUnregister)
1017 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1022 * The window proc for the default IME window
1024 static LRESULT WINAPI IME_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
1027 TRACE("Incomming Message 0x%x (0x%08x, 0x%08x)\n", uMsg, (UINT)wParam,
1035 case WM_IME_COMPOSITION:
1036 TRACE("IME message %s, 0x%x, 0x%x\n",
1037 "WM_IME_COMPOSITION", (UINT)wParam, (UINT)lParam);
1039 case WM_IME_STARTCOMPOSITION:
1040 TRACE("IME message %s, 0x%x, 0x%x\n",
1041 "WM_IME_STARTCOMPOSITION", (UINT)wParam, (UINT)lParam);
1043 case WM_IME_ENDCOMPOSITION:
1044 TRACE("IME message %s, 0x%x, 0x%x\n",
1045 "WM_IME_ENDCOMPOSITION", (UINT)wParam, (UINT)lParam);
1047 * if the string has not been read, then send it as
1048 * WM_IME_CHAR messages
1050 if (!root_context->bRead)
1051 IMM_PostResult(root_context);
1054 TRACE("IME message %s, 0x%x, 0x%x\n","WM_IME_SELECT",
1055 (UINT)wParam, (UINT)lParam);