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
27 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(imm);
33 typedef struct tagInputContextData
35 LPBYTE CompositionString;
36 LPBYTE CompositionReadingString;
38 LPBYTE ResultReadingString;
39 DWORD dwCompStringSize;
40 DWORD dwCompReadStringSize;
41 DWORD dwResultStringSize;
42 DWORD dwResultReadStringSize;
48 static InputContextData *root_context = NULL;
49 static HWND hwndDefault = (HWND)NULL;
50 static HANDLE hImeInst;
51 static const WCHAR WC_IMECLASSNAME[] = {'W','i','n','e','I','M','E','C','l','a','s','s',0};
53 static LRESULT CALLBACK IME_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
55 static VOID IMM_PostResult(InputContextData *data)
59 for (i = 0; i < data->dwResultStringSize / sizeof (WCHAR); i++)
60 SendMessageW(data->hwnd, WM_IME_CHAR, ((WCHAR*)data->ResultString)[i], 1);
63 static void IMM_Register(void)
66 ZeroMemory(&wndClass, sizeof(WNDCLASSW));
67 wndClass.style = CS_GLOBALCLASS | CS_IME;
68 wndClass.lpfnWndProc = IME_WindowProc;
69 wndClass.cbClsExtra = 0;
70 wndClass.cbWndExtra = 0;
71 wndClass.hCursor = (HCURSOR)NULL;
72 wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW +1);
73 wndClass.lpszClassName = WC_IMECLASSNAME;
74 RegisterClassW(&wndClass);
77 static void IMM_Unregister(void)
79 UnregisterClassW(WC_IMECLASSNAME, (HINSTANCE)NULL);
83 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpReserved)
85 TRACE("%p, %lx, %p\n",hInstDLL,fdwReason,lpReserved);
88 case DLL_PROCESS_ATTACH:
91 case DLL_PROCESS_DETACH:
94 DestroyWindow(hwndDefault);
104 /***********************************************************************
105 * ImmAssociateContext (IMM32.@)
107 HIMC WINAPI ImmAssociateContext(HWND hWnd, HIMC hIMC)
109 InputContextData *data = (InputContextData*)hIMC;
111 FIXME("(%p, %p): semi-stub\n",hWnd,hIMC);
117 * WINE SPECIFIC! MAY CONFLICT
118 * associate the root context we have an XIM created
122 root_context = (InputContextData*)hIMC;
126 * If already associated just return
128 if (data->hwnd == hWnd)
131 if (IsWindow(data->hwnd))
134 * Post a message that your context is switching
136 SendMessageW(data->hwnd, WM_IME_SETCONTEXT, FALSE, ISC_SHOWUIALL);
141 if (IsWindow(data->hwnd))
144 * Post a message that your context is switching
146 SendMessageW(data->hwnd, WM_IME_SETCONTEXT, TRUE, ISC_SHOWUIALL);
150 * TODO: We need to keep track of the old context associated
151 * with a window and return it for now we will return NULL;
156 /***********************************************************************
157 * ImmConfigureIMEA (IMM32.@)
159 BOOL WINAPI ImmConfigureIMEA(
160 HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
162 FIXME("(%p, %p, %ld, %p): stub\n",
163 hKL, hWnd, dwMode, lpData
165 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
169 /***********************************************************************
170 * ImmConfigureIMEW (IMM32.@)
172 BOOL WINAPI ImmConfigureIMEW(
173 HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
175 FIXME("(%p, %p, %ld, %p): stub\n",
176 hKL, hWnd, dwMode, lpData
178 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
182 /***********************************************************************
183 * ImmCreateContext (IMM32.@)
185 HIMC WINAPI ImmCreateContext(void)
187 InputContextData *new_context;
189 new_context = HeapAlloc(GetProcessHeap(),0,sizeof(InputContextData));
190 ZeroMemory(new_context,sizeof(InputContextData));
192 return (HIMC)new_context;
195 /***********************************************************************
196 * ImmDestroyContext (IMM32.@)
198 BOOL WINAPI ImmDestroyContext(HIMC hIMC)
200 InputContextData *data = (InputContextData*)hIMC;
202 TRACE("Destroying %p\n",hIMC);
206 if (data->dwCompStringSize)
207 HeapFree(GetProcessHeap(),0,data->CompositionString);
208 if (data->dwCompReadStringSize)
209 HeapFree(GetProcessHeap(),0,data->CompositionReadingString);
210 if (data->dwResultStringSize)
211 HeapFree(GetProcessHeap(),0,data->ResultString);
212 if (data->dwResultReadStringSize)
213 HeapFree(GetProcessHeap(),0,data->ResultReadingString);
215 HeapFree(GetProcessHeap(),0,data);
220 /***********************************************************************
221 * ImmEnumRegisterWordA (IMM32.@)
223 UINT WINAPI ImmEnumRegisterWordA(
224 HKL hKL, REGISTERWORDENUMPROCA lpfnEnumProc,
225 LPCSTR lpszReading, DWORD dwStyle,
226 LPCSTR lpszRegister, LPVOID lpData)
228 FIXME("(%p, %p, %s, %ld, %s, %p): stub\n",
230 debugstr_a(lpszReading), dwStyle,
231 debugstr_a(lpszRegister), lpData
233 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
237 /***********************************************************************
238 * ImmEnumRegisterWordW (IMM32.@)
240 UINT WINAPI ImmEnumRegisterWordW(
241 HKL hKL, REGISTERWORDENUMPROCW lpfnEnumProc,
242 LPCWSTR lpszReading, DWORD dwStyle,
243 LPCWSTR lpszRegister, LPVOID lpData)
245 FIXME("(%p, %p, %s, %ld, %s, %p): stub\n",
247 debugstr_w(lpszReading), dwStyle,
248 debugstr_w(lpszRegister), lpData
250 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
254 /***********************************************************************
255 * ImmEscapeA (IMM32.@)
257 LRESULT WINAPI ImmEscapeA(
259 UINT uEscape, LPVOID lpData)
261 FIXME("(%p, %p, %d, %p): stub\n",
262 hKL, hIMC, uEscape, lpData
264 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
268 /***********************************************************************
269 * ImmEscapeW (IMM32.@)
271 LRESULT WINAPI ImmEscapeW(
273 UINT uEscape, LPVOID lpData)
275 FIXME("(%p, %p, %d, %p): stub\n",
276 hKL, hIMC, uEscape, lpData
278 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
282 /***********************************************************************
283 * ImmGetCandidateListA (IMM32.@)
285 DWORD WINAPI ImmGetCandidateListA(
286 HIMC hIMC, DWORD deIndex,
287 LPCANDIDATELIST lpCandList, DWORD dwBufLen)
289 FIXME("(%p, %ld, %p, %ld): stub\n",
293 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
297 /***********************************************************************
298 * ImmGetCandidateListCountA (IMM32.@)
300 DWORD WINAPI ImmGetCandidateListCountA(
301 HIMC hIMC, LPDWORD lpdwListCount)
303 FIXME("(%p, %p): stub\n", hIMC, lpdwListCount);
304 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
308 /***********************************************************************
309 * ImmGetCandidateListCountW (IMM32.@)
311 DWORD WINAPI ImmGetCandidateListCountW(
312 HIMC hIMC, LPDWORD lpdwListCount)
314 FIXME("(%p, %p): stub\n", hIMC, lpdwListCount);
315 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
319 /***********************************************************************
320 * ImmGetCandidateListW (IMM32.@)
322 DWORD WINAPI ImmGetCandidateListW(
323 HIMC hIMC, DWORD deIndex,
324 LPCANDIDATELIST lpCandList, DWORD dwBufLen)
326 FIXME("(%p, %ld, %p, %ld): stub\n",
330 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
334 /***********************************************************************
335 * ImmGetCandidateWindow (IMM32.@)
337 BOOL WINAPI ImmGetCandidateWindow(
338 HIMC hIMC, DWORD dwBufLen, LPCANDIDATEFORM lpCandidate)
340 FIXME("(%p, %ld, %p): stub\n", hIMC, dwBufLen, lpCandidate);
341 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
345 /***********************************************************************
346 * ImmGetCompositionFontA (IMM32.@)
348 BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
350 FIXME("(%p, %p): stub\n", hIMC, lplf);
351 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
355 /***********************************************************************
356 * ImmGetCompositionFontW (IMM32.@)
358 BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
360 FIXME("(%p, %p): stub\n", hIMC, lplf);
361 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
365 /***********************************************************************
366 * ImmGetCompositionStringA (IMM32.@)
368 LONG WINAPI ImmGetCompositionStringA(
369 HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
372 LPBYTE wcstring=NULL;
374 FIXME("(%p, %ld, %p, %ld): stub\n",
375 hIMC, dwIndex, lpBuf, dwBufLen);
378 wcstring = HeapAlloc(GetProcessHeap(),0,dwBufLen * 2);
380 rc = ImmGetCompositionStringW(hIMC, dwIndex, wcstring, dwBufLen*2 );
382 if ((rc > dwBufLen) || (rc == 0))
385 HeapFree(GetProcessHeap(),0,wcstring);
390 rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)wcstring, (rc / sizeof(WCHAR)),
391 lpBuf, dwBufLen, NULL, NULL);
393 HeapFree(GetProcessHeap(),0,wcstring);
398 /***********************************************************************
399 * ImmGetCompositionStringW (IMM32.@)
401 LONG WINAPI ImmGetCompositionStringW(
402 HIMC hIMC, DWORD dwIndex,
403 LPVOID lpBuf, DWORD dwBufLen)
405 InputContextData *data = (InputContextData*)hIMC;
407 FIXME("(%p, 0x%lx, %p, %ld): stub\n",
408 hIMC, dwIndex, lpBuf, dwBufLen
414 if (dwIndex == GCS_RESULTSTR)
418 if (dwBufLen >= data->dwResultStringSize)
419 memcpy(lpBuf,data->ResultString,data->dwResultStringSize);
421 return data->dwResultStringSize;
424 if (dwIndex == GCS_RESULTREADSTR)
426 if (dwBufLen >= data->dwResultReadStringSize)
427 memcpy(lpBuf,data->ResultReadingString,
428 data->dwResultReadStringSize);
430 return data->dwResultReadStringSize;
433 if (dwIndex == GCS_COMPSTR)
435 if (dwBufLen >= data->dwCompStringSize)
436 memcpy(lpBuf,data->CompositionString,data->dwCompStringSize);
438 return data->dwCompStringSize;
441 if (dwIndex == GCS_COMPREADSTR)
443 if (dwBufLen >= data->dwCompReadStringSize)
444 memcpy(lpBuf,data->CompositionReadingString,
445 data->dwCompReadStringSize);
447 return data->dwCompReadStringSize;
453 /***********************************************************************
454 * ImmGetCompositionWindow (IMM32.@)
456 BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
458 FIXME("(%p, %p): stub\n", hIMC, lpCompForm);
459 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
463 /***********************************************************************
464 * ImmGetContext (IMM32.@)
466 HIMC WINAPI ImmGetContext(HWND hWnd)
468 FIXME("(%p): stub\n", hWnd);
469 return (HIMC)root_context;
472 /***********************************************************************
473 * ImmGetConversionListA (IMM32.@)
475 DWORD WINAPI ImmGetConversionListA(
477 LPCSTR pSrc, LPCANDIDATELIST lpDst,
478 DWORD dwBufLen, UINT uFlag)
480 FIXME("(%p, %p, %s, %p, %ld, %d): stub\n",
481 hKL, hIMC, debugstr_a(pSrc), lpDst, dwBufLen, uFlag
483 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
487 /***********************************************************************
488 * ImmGetConversionListW (IMM32.@)
490 DWORD WINAPI ImmGetConversionListW(
492 LPCWSTR pSrc, LPCANDIDATELIST lpDst,
493 DWORD dwBufLen, UINT uFlag)
495 FIXME("(%p, %p, %s, %p, %ld, %d): stub\n",
496 hKL, hIMC, debugstr_w(pSrc), lpDst, dwBufLen, uFlag
498 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
502 /***********************************************************************
503 * ImmGetConversionStatus (IMM32.@)
505 BOOL WINAPI ImmGetConversionStatus(
506 HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
508 FIXME("(%p, %p, %p): stub\n",
509 hIMC, lpfdwConversion, lpfdwSentence
511 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
515 /***********************************************************************
516 * ImmGetDefaultIMEWnd (IMM32.@)
518 HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
520 FIXME("(%p): semi-stub\n", hWnd);
522 if ((!hwndDefault) && (root_context))
524 static const WCHAR name[] = {'I','M','E',0};
527 hwndDefault = CreateWindowW( WC_IMECLASSNAME,
528 name,WS_POPUPWINDOW,0,0,0,0,0,0,hImeInst,0);
531 return (HWND)hwndDefault;
534 /***********************************************************************
535 * ImmGetDescriptionA (IMM32.@)
537 UINT WINAPI ImmGetDescriptionA(
538 HKL hKL, LPSTR lpszDescription, UINT uBufLen)
540 FIXME("(%p, %s, %d): stub\n",
541 hKL, debugstr_a(lpszDescription), uBufLen
543 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
547 /***********************************************************************
548 * ImmGetDescriptionW (IMM32.@)
550 UINT WINAPI ImmGetDescriptionW(HKL hKL, LPWSTR lpszDescription, UINT uBufLen)
552 FIXME("(%p, %s, %d): stub\n",
553 hKL, debugstr_w(lpszDescription), uBufLen
555 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
559 /***********************************************************************
560 * ImmGetGuideLineA (IMM32.@)
562 DWORD WINAPI ImmGetGuideLineA(
563 HIMC hIMC, DWORD dwIndex, LPSTR lpBuf, DWORD dwBufLen)
565 FIXME("(%p, %ld, %s, %ld): stub\n",
566 hIMC, dwIndex, debugstr_a(lpBuf), dwBufLen
568 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
572 /***********************************************************************
573 * ImmGetGuideLineW (IMM32.@)
575 DWORD WINAPI ImmGetGuideLineW(HIMC hIMC, DWORD dwIndex, LPWSTR lpBuf, DWORD dwBufLen)
577 FIXME("(%p, %ld, %s, %ld): stub\n",
578 hIMC, dwIndex, debugstr_w(lpBuf), dwBufLen
580 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
584 /***********************************************************************
585 * ImmGetIMEFileNameA (IMM32.@)
587 UINT WINAPI ImmGetIMEFileNameA(
588 HKL hKL, LPSTR lpszFileName, UINT uBufLen)
590 FIXME("(%p, %s, %d): stub\n",
591 hKL, debugstr_a(lpszFileName), uBufLen
593 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
597 /***********************************************************************
598 * ImmGetIMEFileNameW (IMM32.@)
600 UINT WINAPI ImmGetIMEFileNameW(
601 HKL hKL, LPWSTR lpszFileName, UINT uBufLen)
603 FIXME("(%p, %s, %d): stub\n",
604 hKL, debugstr_w(lpszFileName), uBufLen
606 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
610 /***********************************************************************
611 * ImmGetOpenStatus (IMM32.@)
613 BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
615 InputContextData *data = (InputContextData*)hIMC;
617 FIXME("(%p): semi-stub\n", hIMC);
622 /***********************************************************************
623 * ImmGetProperty (IMM32.@)
625 DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex)
628 FIXME("(%p, %ld): semi-stub\n", hKL, fdwIndex);
633 rc = IME_PROP_UNICODE | IME_PROP_SPECIAL_UI;
636 rc = SCS_CAP_COMPSTR;
639 rc = SELECT_CAP_CONVERSION | SELECT_CAP_SENTENCE;
641 case IGP_GETIMEVERSION:
651 /***********************************************************************
652 * ImmGetRegisterWordStyleA (IMM32.@)
654 UINT WINAPI ImmGetRegisterWordStyleA(
655 HKL hKL, UINT nItem, LPSTYLEBUFA lpStyleBuf)
657 FIXME("(%p, %d, %p): stub\n", hKL, nItem, lpStyleBuf);
658 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
662 /***********************************************************************
663 * ImmGetRegisterWordStyleW (IMM32.@)
665 UINT WINAPI ImmGetRegisterWordStyleW(
666 HKL hKL, UINT nItem, LPSTYLEBUFW lpStyleBuf)
668 FIXME("(%p, %d, %p): stub\n", hKL, nItem, lpStyleBuf);
669 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
673 /***********************************************************************
674 * ImmGetStatusWindowPos (IMM32.@)
676 BOOL WINAPI ImmGetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
678 FIXME("(%p, %p): stub\n", hIMC, lpptPos);
679 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
683 /***********************************************************************
684 * ImmGetVirtualKey (IMM32.@)
686 UINT WINAPI ImmGetVirtualKey(HWND hWnd)
688 OSVERSIONINFOA version;
689 FIXME("(%p): stub\n", hWnd);
690 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
691 GetVersionExA( &version );
692 switch(version.dwPlatformId)
694 case VER_PLATFORM_WIN32_WINDOWS:
695 return VK_PROCESSKEY;
696 case VER_PLATFORM_WIN32_NT:
699 FIXME("%ld not supported\n",version.dwPlatformId);
700 return VK_PROCESSKEY;
704 /***********************************************************************
705 * ImmInstallIMEA (IMM32.@)
707 HKL WINAPI ImmInstallIMEA(
708 LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
710 FIXME("(%s, %s): stub\n",
711 debugstr_a(lpszIMEFileName), debugstr_a(lpszLayoutText)
713 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
717 /***********************************************************************
718 * ImmInstallIMEW (IMM32.@)
720 HKL WINAPI ImmInstallIMEW(
721 LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
723 FIXME("(%s, %s): stub\n",
724 debugstr_w(lpszIMEFileName), debugstr_w(lpszLayoutText)
726 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
730 /***********************************************************************
733 BOOL WINAPI ImmIsIME(HKL hKL)
735 FIXME("(%p): semi-stub\n", hKL);
737 * Dead key locales will return TRUE here when they should not
738 * There is probibly a more proper way to check this.
740 return (root_context != NULL);
743 /***********************************************************************
744 * ImmIsUIMessageA (IMM32.@)
746 BOOL WINAPI ImmIsUIMessageA(
747 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
749 FIXME("(%p, %d, %d, %ld): stub\n",
750 hWndIME, msg, wParam, lParam
752 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
756 /***********************************************************************
757 * ImmIsUIMessageW (IMM32.@)
759 BOOL WINAPI ImmIsUIMessageW(
760 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
762 FIXME("(%p, %d, %d, %ld): stub\n",
763 hWndIME, msg, wParam, lParam
765 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
769 /***********************************************************************
770 * ImmNotifyIME (IMM32.@)
772 BOOL WINAPI ImmNotifyIME(
773 HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
775 FIXME("(%p, %ld, %ld, %ld): stub\n",
776 hIMC, dwAction, dwIndex, dwValue
778 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
782 /***********************************************************************
783 * ImmRegisterWordA (IMM32.@)
785 BOOL WINAPI ImmRegisterWordA(
786 HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszRegister)
788 FIXME("(%p, %s, %ld, %s): stub\n",
789 hKL, debugstr_a(lpszReading), dwStyle, debugstr_a(lpszRegister)
791 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
795 /***********************************************************************
796 * ImmRegisterWordW (IMM32.@)
798 BOOL WINAPI ImmRegisterWordW(
799 HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszRegister)
801 FIXME("(%p, %s, %ld, %s): stub\n",
802 hKL, debugstr_w(lpszReading), dwStyle, debugstr_w(lpszRegister)
804 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
808 /***********************************************************************
809 * ImmReleaseContext (IMM32.@)
811 BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
813 FIXME("(%p, %p): stub\n", hWnd, hIMC);
814 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
818 /***********************************************************************
819 * ImmSetCandidateWindow (IMM32.@)
821 BOOL WINAPI ImmSetCandidateWindow(
822 HIMC hIMC, LPCANDIDATEFORM lpCandidate)
824 FIXME("(%p, %p): stub\n", hIMC, lpCandidate);
825 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
829 /***********************************************************************
830 * ImmSetCompositionFontA (IMM32.@)
832 BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
834 FIXME("(%p, %p): stub\n", hIMC, lplf);
835 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
839 /***********************************************************************
840 * ImmSetCompositionFontW (IMM32.@)
842 BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
844 FIXME("(%p, %p): stub\n", hIMC, lplf);
845 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
849 /***********************************************************************
850 * ImmSetCompositionStringA (IMM32.@)
852 BOOL WINAPI ImmSetCompositionStringA(
853 HIMC hIMC, DWORD dwIndex,
854 LPCVOID lpComp, DWORD dwCompLen,
855 LPCVOID lpRead, DWORD dwReadLen)
857 FIXME("(%p, %ld, %p, %ld, %p, %ld): stub\n",
858 hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen
860 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
864 /***********************************************************************
865 * ImmSetCompositionStringW (IMM32.@)
867 BOOL WINAPI ImmSetCompositionStringW(
868 HIMC hIMC, DWORD dwIndex,
869 LPCVOID lpComp, DWORD dwCompLen,
870 LPCVOID lpRead, DWORD dwReadLen)
872 InputContextData *data = (InputContextData*)hIMC;
874 FIXME("(%p, %ld, %p, %ld, %p, %ld): semi-stub\n",
875 hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen
881 if ((dwIndex == SCS_SETSTR)&&(dwCompLen || dwReadLen))
882 SendMessageW(data->hwnd, WM_IME_STARTCOMPOSITION, 0, 0);
884 if (dwIndex == SCS_SETSTR)
889 if (lpComp && dwCompLen)
891 /* if (data->dwCompStringSize)
892 HeapFree(GetProcessHeap(),0,data->CompositionString);
893 data->dwCompStringSize = dwCompLen;
894 data->CompositionString = HeapAlloc(GetProcessHeap(),0,dwCompLen);
895 memcpy(data->CompositionString,lpComp,dwCompLen);
896 send_comp |= GCS_COMPSTR;
900 if (data->dwResultStringSize)
901 HeapFree(GetProcessHeap(),0,data->ResultString);
902 data->dwResultStringSize= dwCompLen;
903 data->ResultString= HeapAlloc(GetProcessHeap(),0,dwCompLen);
904 memcpy(data->ResultString,lpComp,dwCompLen);
905 send_comp |= GCS_RESULTSTR;
908 if (lpRead && dwReadLen)
910 if (data->dwCompReadStringSize)
911 HeapFree(GetProcessHeap(),0,data->CompositionReadingString);
912 data->dwCompReadStringSize= dwReadLen;
913 data->CompositionReadingString = HeapAlloc(GetProcessHeap(), 0,
915 memcpy(data->CompositionReadingString,lpRead,dwReadLen);
916 send_comp |= GCS_COMPREADSTR;
920 SendMessageW(data->hwnd, WM_IME_COMPOSITION, 0, send_comp);
922 SendMessageW(data->hwnd, WM_IME_ENDCOMPOSITION, 0, 0);
929 /***********************************************************************
930 * ImmSetCompositionWindow (IMM32.@)
932 BOOL WINAPI ImmSetCompositionWindow(
933 HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
935 FIXME("(%p, %p): stub\n", hIMC, lpCompForm);
936 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
940 /***********************************************************************
941 * ImmSetConversionStatus (IMM32.@)
943 BOOL WINAPI ImmSetConversionStatus(
944 HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
946 FIXME("(%p, %ld, %ld): stub\n",
947 hIMC, fdwConversion, fdwSentence
949 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
953 /***********************************************************************
954 * ImmSetOpenStatus (IMM32.@)
956 BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
958 InputContextData *data = (InputContextData*)hIMC;
959 FIXME("Semi-Stub\n");
963 SendMessageW(data->hwnd, WM_IME_NOTIFY, IMN_SETOPENSTATUS, 0);
970 /***********************************************************************
971 * ImmSetStatusWindowPos (IMM32.@)
973 BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
975 FIXME("(%p, %p): stub\n", hIMC, lpptPos);
976 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
980 /***********************************************************************
981 * ImmSimulateHotKey (IMM32.@)
983 BOOL WINAPI ImmSimulateHotKey(HWND hWnd, DWORD dwHotKeyID)
985 FIXME("(%p, %ld): stub\n", hWnd, dwHotKeyID);
986 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
990 /***********************************************************************
991 * ImmUnregisterWordA (IMM32.@)
993 BOOL WINAPI ImmUnregisterWordA(
994 HKL hKL, LPCSTR lpszReading, DWORD dwStyle, LPCSTR lpszUnregister)
996 FIXME("(%p, %s, %ld, %s): stub\n",
997 hKL, debugstr_a(lpszReading), dwStyle, debugstr_a(lpszUnregister)
999 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1003 /***********************************************************************
1004 * ImmUnregisterWordW (IMM32.@)
1006 BOOL WINAPI ImmUnregisterWordW(
1007 HKL hKL, LPCWSTR lpszReading, DWORD dwStyle, LPCWSTR lpszUnregister)
1009 FIXME("(%p, %s, %ld, %s): stub\n",
1010 hKL, debugstr_w(lpszReading), dwStyle, debugstr_w(lpszUnregister)
1012 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
1017 * The window proc for the default IME window
1019 static LRESULT WINAPI IME_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
1022 TRACE("Incomming Message 0x%x (0x%08x, 0x%08x)\n", uMsg, (UINT)wParam,
1030 case WM_IME_COMPOSITION:
1031 TRACE("IME message %s, 0x%x, 0x%x\n",
1032 "WM_IME_COMPOSITION", (UINT)wParam, (UINT)lParam);
1034 case WM_IME_STARTCOMPOSITION:
1035 TRACE("IME message %s, 0x%x, 0x%x\n",
1036 "WM_IME_STARTCOMPOSITION", (UINT)wParam, (UINT)lParam);
1038 case WM_IME_ENDCOMPOSITION:
1039 TRACE("IME message %s, 0x%x, 0x%x\n",
1040 "WM_IME_ENDCOMPOSITION", (UINT)wParam, (UINT)lParam);
1042 * if the string has not been read, then send it as
1043 * WM_IME_CHAR messages
1045 if (!root_context->bRead)
1046 IMM_PostResult(root_context);
1049 TRACE("IME message %s, 0x%x, 0x%x\n","WM_IME_SELECT",
1050 (UINT)wParam, (UINT)lParam);