ReactOS  0.4.15-dev-4616-g17e0e44
imm.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS user32.dll
4  * FILE: win32ss/user/user32/misc/imm.c
5  * PURPOSE: User32.dll Imm functions
6  * PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org)
7  * Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
8  */
9 
10 #include <user32.h>
11 #include <strsafe.h>
12 #include <ddk/immdev.h>
13 
15 
16 #define IMM_INIT_MAGIC 0x19650412
17 #define MAX_CANDIDATEFORM 4
18 
19 /* Is != NULL when we have loaded the IMM ourselves */
20 HINSTANCE ghImm32 = NULL; // Win: ghImm32
21 
22 BOOL gbImmInitializing = FALSE; // Win: bImmInitializing
23 
24 INT gfConIme = -1; // Win: gfConIme
25 
27 {
28  DWORD style;
29 
30  for (; hWnd; hWnd = GetParent(hWnd))
31  {
33  if (!(style & WS_CHILD))
34  break;
35  }
36 
37  return hWnd;
38 }
39 
40 /* define stub functions */
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); }
44 #include "immtable.h"
45 
46 // Win: gImmApiEntries
48 /* initialize by stubs */
49 #undef DEFINE_IMM_ENTRY
50 #define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
51  IMMSTUB_##name,
52 #include "immtable.h"
53 };
54 
55 // Win: GetImmFileName
56 HRESULT
58 {
60  if (length && length < cchBuffer)
61  {
63  return StringCchCatW(lpBuffer, cchBuffer, L"imm32.dll");
64  }
65  return StringCchCopyW(lpBuffer, cchBuffer, L"imm32.dll");
66 }
67 
68 // @unimplemented
69 // Win: _InitializeImmEntryTable
71 {
72  WCHAR ImmFile[MAX_PATH];
73  HMODULE imm32 = ghImm32;
74 
75  /* Check whether the IMM table has already been initialized */
76  if (IMM_FN(ImmWINNLSEnableIME) != IMMSTUB_ImmWINNLSEnableIME)
77  return TRUE;
78 
79  User32GetImmFileName(ImmFile, _countof(ImmFile));
80  TRACE("File %S\n", ImmFile);
81 
82  /* If IMM32 is already loaded, use it without increasing reference count. */
83  if (imm32 == NULL)
84  imm32 = GetModuleHandleW(ImmFile);
85 
86  /*
87  * Loading imm32.dll will call imm32!DllMain function.
88  * imm32!DllMain calls User32InitializeImmEntryTable.
89  * Thus, if imm32.dll was loaded, the table has been loaded.
90  */
91  if (imm32 == NULL)
92  {
93  imm32 = ghImm32 = LoadLibraryW(ImmFile);
94  if (imm32 == NULL)
95  {
96  ERR("Did not load imm32.dll!\n");
97  return FALSE;
98  }
99  return TRUE;
100  }
101 
102 /* load imm procedures */
103 #undef DEFINE_IMM_ENTRY
104 #define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
105  do { \
106  FN_##name proc = (FN_##name)GetProcAddress(imm32, #name); \
107  if (!proc) { \
108  ERR("Could not load %s\n", #name); \
109  return FALSE; \
110  } \
111  IMM_FN(name) = proc; \
112  } while (0);
113 #include "immtable.h"
114 
115  return TRUE;
116 }
117 
118 // Win: InitializeImmEntryTable
120 {
123 }
124 
125 // Win: User32InitializeImmEntryTable
127 {
128  TRACE("Imm (%x)\n", magic);
129 
130  if (magic != IMM_INIT_MAGIC)
131  return FALSE;
132 
133  /* Check whether the IMM table has already been initialized */
134  if (IMM_FN(ImmWINNLSEnableIME) != IMMSTUB_ImmWINNLSEnableIME)
135  return TRUE;
136 
138 
139  if (ghImm32 == NULL && !gbImmInitializing)
140  {
141  WCHAR ImmFile[MAX_PATH];
142  User32GetImmFileName(ImmFile, _countof(ImmFile));
143  ghImm32 = LoadLibraryW(ImmFile);
144  if (ghImm32 == NULL)
145  {
146  ERR("Did not load imm32.dll!\n");
147  return FALSE;
148  }
149  }
150 
152 }
153 
154 // Win: ImeIsUsableContext
156 {
157  PIMC pIMC = ValidateHandle(hIMC, TYPE_INPUTCONTEXT);
158  return pIMC && (!pIMC->hImeWnd || pIMC->hImeWnd == hImeWnd || !ValidateHwnd(pIMC->hImeWnd));
159 }
160 
161 // Win: GetIMEShowStatus
163 {
165 }
166 
167 // Win: SendMessageToUI(pimeui, uMsg, wParam, lParam, !unicode)
168 static LRESULT
170 {
171  LRESULT ret = 0;
172  HWND hwndUI = pimeui->hwndUI;
173  PWND pwnd, pwndUI;
174 
175  ASSERT(pimeui->spwnd != NULL);
176 
177  pwnd = pimeui->spwnd;
178  pwndUI = ValidateHwnd(hwndUI);
179  if (!pwnd || (pwnd->state & WNDS_DESTROYED) || (pwnd->state2 & WNDS2_INDESTROY) ||
180  !pwndUI || (pwndUI->state & WNDS_DESTROYED) || (pwndUI->state2 & WNDS2_INDESTROY))
181  {
182  return 0;
183  }
184 
186 
187  if (unicode)
188  ret = SendMessageW(hwndUI, uMsg, wParam, lParam);
189  else
190  ret = SendMessageA(hwndUI, uMsg, wParam, lParam);
191 
193 
194  return ret;
195 }
196 
197 // Win: SendOpenStatusNotify
198 static VOID User32NotifyOpenStatus(PIMEUI pimeui, HWND hwndIMC, BOOL bOpen)
199 {
201 
202  ASSERT(pimeui->spwnd != NULL);
203 
204  pimeui->fShowStatus = bOpen;
205 
206  if (LOWORD(GetWin32ClientInfo()->dwExpWinVer) >= 0x400)
207  SendMessageW(hwndIMC, WM_IME_NOTIFY, wParam, 0);
208  else
210 }
211 
212 // Win: ImeMarkUsedContext
213 static VOID User32SetImeWindowOfImc(HIMC hIMC, HWND hImeWnd)
214 {
215  PIMC pIMC = ValidateHandle(hIMC, TYPE_INPUTCONTEXT);
216  if (!pIMC || pIMC->hImeWnd == hImeWnd)
217  return;
218 
220 }
221 
222 // Win: ImeSetImc
223 static VOID User32UpdateImcOfImeUI(PIMEUI pimeui, HIMC hNewIMC)
224 {
225  HWND hImeWnd;
226  HIMC hOldIMC = pimeui->hIMC;
227 
228  ASSERT(pimeui->spwnd != NULL);
229  hImeWnd = UserHMGetHandle(pimeui->spwnd);
230 
231  if (hNewIMC == hOldIMC)
232  return;
233 
234  if (hOldIMC)
235  User32SetImeWindowOfImc(hOldIMC, NULL);
236 
237  pimeui->hIMC = hNewIMC;
238 
239  if (hNewIMC)
240  User32SetImeWindowOfImc(hNewIMC, hImeWnd);
241 }
242 
243 // Win: ImeNotifyHandler
245 {
246  LRESULT ret = 0;
247  HIMC hIMC;
248  LPINPUTCONTEXT pIC;
249  HWND hwndUI, hwndIMC, hImeWnd, hwndOwner;
250 
251  ASSERT(pimeui->spwnd != NULL);
252 
253  switch (wParam)
254  {
256  case IMN_SETOPENSTATUS:
257  hIMC = pimeui->hIMC;
258  pIC = IMM_FN(ImmLockIMC)(hIMC);
259  if (pIC)
260  {
261  hwndIMC = pimeui->hwndIMC;
262  if (IsWindow(hwndIMC))
263  {
264  NtUserNotifyIMEStatus(hwndIMC, pIC->fOpen, pIC->fdwConversion);
265  }
266  else if (gfConIme == TRUE && pimeui->spwnd)
267  {
268  hImeWnd = UserHMGetHandle(pimeui->spwnd);
269  hwndOwner = GetWindow(hImeWnd, GW_OWNER);
270  if (hwndOwner)
271  {
272  NtUserNotifyIMEStatus(hwndOwner, pIC->fOpen, pIC->fdwConversion);
273  }
274  }
275 
276  IMM_FN(ImmUnlockIMC)(hIMC);
277  }
278  /* FALL THROUGH */
279  default:
281  break;
282 
283  case IMN_PRIVATE:
284  hwndUI = pimeui->hwndUI;
285  if (IsWindow(hwndUI))
287  break;
288  }
289 
290  return ret;
291 }
292 
293 // Win: CreateIMEUI
295 {
296  IMEINFOEX ImeInfoEx;
297  PIMEDPI pImeDpi;
298  WNDCLASSW wc;
299  HWND hwndUI = NULL;
300  CHAR szUIClass[32];
301  PWND pwnd = pimeui->spwnd;
302 
303  ASSERT(pimeui->spwnd != NULL);
304 
305  if (!pwnd || !IMM_FN(ImmGetImeInfoEx)(&ImeInfoEx, ImeInfoExKeyboardLayout, &hKL))
306  return NULL;
307 
308  pImeDpi = IMM_FN(ImmLockImeDpi)(hKL);
309  if (!pImeDpi)
310  return NULL;
311 
312  if (!GetClassInfoW(pImeDpi->hInst, ImeInfoEx.wszUIClass, &wc))
313  goto Quit;
314 
315  if (ImeInfoEx.ImeInfo.fdwProperty & IME_PROP_UNICODE)
316  {
317  hwndUI = CreateWindowW(ImeInfoEx.wszUIClass, ImeInfoEx.wszUIClass, WS_POPUP | WS_DISABLED,
318  0, 0, 0, 0, UserHMGetHandle(pwnd), 0, wc.hInstance, NULL);
319  }
320  else
321  {
322  WideCharToMultiByte(CP_ACP, 0, ImeInfoEx.wszUIClass, -1,
323  szUIClass, _countof(szUIClass), NULL, NULL);
324  szUIClass[_countof(szUIClass) - 1] = 0;
325 
326  hwndUI = CreateWindowA(szUIClass, szUIClass, WS_POPUP | WS_DISABLED,
327  0, 0, 0, 0, UserHMGetHandle(pwnd), 0, wc.hInstance, NULL);
328  }
329 
330  if (hwndUI)
331  NtUserSetWindowLong(hwndUI, IMMGWL_IMC, (LONG_PTR)pimeui->hIMC, FALSE);
332 
333 Quit:
334  IMM_FN(ImmUnlockImeDpi)(pImeDpi);
335  return hwndUI;
336 }
337 
338 // Win: ImeWndCreateHandler
340 {
341  PWND pParentWnd, pWnd = pimeui->spwnd;
342  HIMC hIMC = NULL;
343 
344  if (!pWnd || (pWnd->style & (WS_DISABLED | WS_POPUP)) != (WS_DISABLED | WS_POPUP))
345  return FALSE;
346 
347  pParentWnd = ValidateHwnd(lpCS->hwndParent);
348  if (pParentWnd)
349  {
350  hIMC = pParentWnd->hImc;
351  if (hIMC && !User32CanSetImeWindowToImc(hIMC, UserHMGetHandle(pWnd)))
352  hIMC = NULL;
353  }
354 
355  User32UpdateImcOfImeUI(pimeui, hIMC);
356 
357  pimeui->fShowStatus = FALSE;
358  pimeui->nCntInIMEProc = 0;
359  pimeui->fActivate = FALSE;
360  pimeui->fDestroy = FALSE;
361  pimeui->hwndIMC = NULL;
362  pimeui->hKL = GetWin32ClientInfo()->hKL;
363  pimeui->fCtrlShowStatus = TRUE;
364 
365  IMM_FN(ImmLoadIME)(pimeui->hKL);
366 
367  pimeui->hwndUI = NULL;
368 
369  return TRUE;
370 }
371 
372 // Win: DestroyIMEUI
374 {
375  HWND hwndUI = pimeui->hwndUI;
376 
377  if (IsWindow(hwndUI))
378  {
379  pimeui->fDestroy = TRUE;
380  NtUserDestroyWindow(hwndUI);
381  }
382 
383  pimeui->fShowStatus = pimeui->fDestroy = FALSE;
384  pimeui->hwndUI = NULL;
385 }
386 
387 // Win: ImeSelectHandler
389 {
390  HKL hKL;
391  HWND hwndUI, hwndIMC = pimeui->hwndIMC;
392 
393  if (wParam)
394  {
395  pimeui->hKL = hKL = (HKL)lParam;
396  pimeui->hwndUI = hwndUI = User32CreateImeUIWindow(pimeui, hKL);
397  if (hwndUI)
399 
400  if (User32GetImeShowStatus() && pimeui->fCtrlShowStatus)
401  {
402  if (!pimeui->fShowStatus && pimeui->fActivate && IsWindow(hwndIMC))
403  User32NotifyOpenStatus(pimeui, hwndIMC, TRUE);
404  }
405  }
406  else
407  {
408  if (pimeui->fShowStatus && pimeui->fActivate && IsWindow(hwndIMC))
409  User32NotifyOpenStatus(pimeui, hwndIMC, FALSE);
410 
412  User32DestroyImeUIWindow(pimeui);
413  pimeui->hKL = NULL;
414  }
415 }
416 
417 // Win: ImeControlHandler(pimeui, wParam, lParam, !unicode)
418 static LRESULT
420 {
421  HIMC hIMC = pimeui->hIMC;
422  DWORD dwConversion, dwSentence;
423  POINT pt;
424 
425  if (!hIMC)
426  return 0;
427 
428  switch (wParam)
429  {
431  if (!IMM_FN(ImmGetConversionStatus)(hIMC, &dwConversion, &dwSentence))
432  return 1;
433  return dwConversion;
434 
435  case IMC_GETSENTENCEMODE:
436  if (!IMM_FN(ImmGetConversionStatus)(hIMC, &dwConversion, &dwSentence))
437  return 1;
438  return dwSentence;
439 
440  case IMC_GETOPENSTATUS:
441  return IMM_FN(ImmGetOpenStatus)(hIMC);
442 
444  if (!IMM_FN(ImmGetConversionStatus)(hIMC, &dwConversion, &dwSentence) ||
445  !IMM_FN(ImmSetConversionStatus)(hIMC, (DWORD)lParam, dwSentence))
446  {
447  return 1;
448  }
449  break;
450 
451  case IMC_SETSENTENCEMODE:
452  if (!IMM_FN(ImmGetConversionStatus)(hIMC, &dwConversion, &dwSentence) ||
453  !IMM_FN(ImmSetConversionStatus)(hIMC, dwConversion, (DWORD)lParam))
454  {
455  return 1;
456  }
457  break;
458 
459  case IMC_SETOPENSTATUS:
460  if (!IMM_FN(ImmSetOpenStatus)(hIMC, (BOOL)lParam))
461  return 1;
462  break;
463 
464  case IMC_GETCANDIDATEPOS:
466  case IMC_GETSOFTKBDPOS:
467  case IMC_SETSOFTKBDPOS:
469  return User32SendImeUIMessage(pimeui, WM_IME_CONTROL, wParam, lParam, unicode);
470 
471  case IMC_SETCANDIDATEPOS:
473  return 1;
474  break;
475 
477  if (unicode)
478  {
480  return 1;
481  }
482  else
483  {
485  return 1;
486  }
487  break;
488 
490  if (unicode)
491  {
493  return 1;
494  }
495  else
496  {
498  return 1;
499  }
500  break;
501 
504  return 1;
505  break;
506 
508  pt.x = GET_X_LPARAM(lParam);
509  pt.y = GET_Y_LPARAM(lParam);
510  if (!IMM_FN(ImmSetStatusWindowPos)(hIMC, &pt))
511  return 1;
512  break;
513 
515  if (pimeui->fShowStatus && User32GetImeShowStatus())
516  {
517  pimeui->fShowStatus = FALSE;
519  }
520  pimeui->fCtrlShowStatus = FALSE;
521  break;
522 
524  if (!pimeui->fShowStatus && User32GetImeShowStatus())
525  {
526  pimeui->fShowStatus = TRUE;
528  }
529  pimeui->fCtrlShowStatus = TRUE;
530  break;
531 
532  default:
533  break;
534  }
535 
536  return 0;
537 }
538 
539 // Win: FocusSetIMCContext
541 {
542  HIMC hIMC;
543 
544  if (!hWnd || !IsWindow(hWnd))
545  {
546  IMM_FN(ImmSetActiveContext)(NULL, NULL, bActive);
547  return;
548  }
549 
550  hIMC = IMM_FN(ImmGetContext)(hWnd);
551  IMM_FN(ImmSetActiveContext)(hWnd, hIMC, bActive);
552  IMM_FN(ImmReleaseContext)(hWnd, hIMC);
553 }
554 
555 // Win: ImeSystemHandler
557 {
558  LRESULT ret = 0;
559  LPINPUTCONTEXTDX pIC;
560  HIMC hIMC = pimeui->hIMC;
561  LPCANDIDATEFORM pCandForm;
562  LPCOMPOSITIONFORM pCompForm;
563  DWORD dwConversion, dwSentence;
564  HWND hImeWnd;
565  BOOL bCompForm;
566  CANDIDATEFORM CandForm;
567  COMPOSITIONFORM CompForm;
568  UINT iCandForm;
569 
570  ASSERT(pimeui->spwnd != NULL);
571 
572  switch (wParam)
573  {
574  case 0x05:
575  if (User32GetImeShowStatus() == !lParam)
576  {
577  hImeWnd = UserHMGetHandle(pimeui->spwnd);
579  }
580  break;
581 
582  case 0x06:
583  if (!hIMC)
584  break;
585 
586  bCompForm = TRUE;
587  pIC = IMM_FN(ImmLockIMC)(hIMC);
588  if (pIC)
589  {
590  bCompForm = !(pIC->dwUIFlags & 0x2);
591  IMM_FN(ImmUnlockIMC)(hIMC);
592  }
593 
594  if (!IsWindow(pimeui->hwndIMC))
595  break;
596 
597  if (bCompForm && IMM_FN(ImmGetCompositionWindow)(hIMC, &CompForm))
598  {
599  if (CompForm.dwStyle)
600  IMM_FN(ImmSetCompositionWindow)(hIMC, &CompForm);
601  }
602 
603  for (iCandForm = 0; iCandForm < MAX_CANDIDATEFORM; ++iCandForm)
604  {
605  if (IMM_FN(ImmGetCandidateWindow)(hIMC, iCandForm, &CandForm))
606  {
607  if (CandForm.dwStyle)
608  IMM_FN(ImmSetCandidateWindow)(hIMC, &CandForm);
609  }
610  }
611  break;
612 
613  case 0x09:
614  pIC = IMM_FN(ImmLockIMC)(hIMC);
615  if (!pIC)
616  break;
617 
618  pCandForm = &pIC->cfCandForm[lParam];
619  IMM_FN(ImmSetCandidateWindow)(hIMC, pCandForm);
620  IMM_FN(ImmUnlockIMC)(hIMC);
621  break;
622 
623  case 0x0A:
624  pIC = IMM_FN(ImmLockIMC)(hIMC);
625  if (!pIC)
626  break;
627 
628  IMM_FN(ImmSetCompositionFontW)(hIMC, &pIC->lfFont.W);
629  IMM_FN(ImmUnlockIMC)(hIMC);
630  break;
631 
632  case 0x0B:
633  pIC = IMM_FN(ImmLockIMC)(hIMC);
634  if (!pIC)
635  break;
636 
637  pCompForm = &pIC->cfCompForm;
638  pIC->dwUIFlags |= 0x8;
639  IMM_FN(ImmSetCompositionWindow)(hIMC, pCompForm);
640  IMM_FN(ImmUnlockIMC)(hIMC);
641  break;
642 
643  case 0x0D:
645  break;
646 
647  case 0x0F:
648  if (hIMC)
650  break;
651 
652  case 0x11:
654  break;
655 
656  case 0x13:
657  // TODO:
658  break;
659 
660  case 0x14:
661  IMM_FN(ImmGetConversionStatus)(hIMC, &dwConversion, &dwSentence);
662  ret = dwConversion;
663  break;
664 
665  case 0x15:
666  // TODO:
667  break;
668 
669  case IMS_IMEACTIVATE:
671  break;
672 
673  case IMS_IMEDEACTIVATE:
675  break;
676 
677  case IMS_ACTIVATELAYOUT:
679  break;
680 
681  case 0x1C:
682  ret = IMM_FN(ImmPutImeMenuItemsIntoMappedFile)((HIMC)lParam);
683  break;
684 
685  case 0x1D:
686  // TODO:
687  break;
688 
689  case 0x1E:
691  break;
692 
693  case 0x1F:
694  case 0x20:
696  break;
697 
698  default:
699  break;
700  }
701 
702  return ret;
703 }
704 
705 // Win: ImeSetContextHandler
707 {
708  LRESULT ret;
709  HIMC hIMC;
710  LPINPUTCONTEXTDX pIC;
711  HWND hwndFocus, hwndOldImc, hwndNewImc, hImeWnd, hwndActive, hwndOwner;
712  PWND pwndFocus, pImeWnd, pwndOwner;
713  COMPOSITIONFORM CompForm;
714 
715  pimeui->fActivate = !!wParam;
716  hwndOldImc = pimeui->hwndIMC;
717  ASSERT(pimeui->spwnd != NULL);
718 
719  if (wParam)
720  {
721  if (!pimeui->hwndUI)
722  pimeui->hwndUI = User32CreateImeUIWindow(pimeui, pimeui->hKL);
723 
724  if (gfConIme == -1)
725  {
727  if (gfConIme)
728  pimeui->fCtrlShowStatus = FALSE;
729  }
730 
731  hImeWnd = UserHMGetHandle(pimeui->spwnd);
732 
733  if (gfConIme)
734  {
735  hwndOwner = GetWindow(hImeWnd, GW_OWNER);
736  pwndOwner = ValidateHwnd(hwndOwner);
737  if (pwndOwner)
738  {
739  User32UpdateImcOfImeUI(pimeui, pwndOwner->hImc);
740 
741  if (pimeui->hwndUI)
742  SetWindowLongPtrW(pimeui->hwndUI, IMMGWLP_IMC, (LONG_PTR)pwndOwner->hImc);
743  }
744 
746  }
747 
748  hwndFocus = (HWND)NtUserQueryWindow(hImeWnd, QUERY_WINDOW_FOCUS);
749 
750  hIMC = IMM_FN(ImmGetContext)(hwndFocus);
751 
752  if (hIMC && !User32CanSetImeWindowToImc(hIMC, hImeWnd))
753  {
754  User32UpdateImcOfImeUI(pimeui, NULL);
755  return 0;
756  }
757 
758  User32UpdateImcOfImeUI(pimeui, hIMC);
759 
760  if (pimeui->hwndUI)
761  SetWindowLongPtrW(pimeui->hwndUI, IMMGWLP_IMC, (LONG_PTR)hIMC);
762 
763  if (hIMC)
764  {
765  pIC = IMM_FN(ImmLockIMC)(hIMC);
766  if (!pIC)
767  return 0;
768 
769  if (hwndFocus != pIC->hWnd)
770  {
771  IMM_FN(ImmUnlockIMC)(hIMC);
772  return 0;
773  }
774 
775  if ((pIC->dwUIFlags & 0x40000) && hwndOldImc != hwndFocus)
776  {
777  RtlZeroMemory(&CompForm, sizeof(CompForm));
778  IMM_FN(ImmSetCompositionWindow)(hIMC, &CompForm);
779 
780  pIC->dwUIFlags &= ~0x40000;
781  }
782 
783  IMM_FN(ImmUnlockIMC)(hIMC);
784 
785  hImeWnd = UserHMGetHandle(pimeui->spwnd);
786  if (NtUserSetImeOwnerWindow(hImeWnd, hwndFocus))
787  pimeui->hwndIMC = hwndFocus;
788  }
789  else
790  {
791  pimeui->hwndIMC = hwndFocus;
792 
793  hImeWnd = UserHMGetHandle(pimeui->spwnd);
794  NtUserSetImeOwnerWindow(hImeWnd, NULL);
795  }
796  }
797 
799 
800  if (!pimeui->spwnd)
801  return 0;
802 
803  if (!pimeui->fCtrlShowStatus || !User32GetImeShowStatus())
804  return ret;
805 
806  hImeWnd = UserHMGetHandle(pimeui->spwnd);
807  hwndFocus = (HWND)NtUserQueryWindow(hImeWnd, QUERY_WINDOW_FOCUS);
808  pwndFocus = ValidateHwnd(hwndFocus);
809 
810  if (wParam)
811  {
812  pImeWnd = ValidateHwnd(hImeWnd);
813  if (pwndFocus && pImeWnd && pImeWnd->head.pti == pwndFocus->head.pti)
814  {
815  hwndNewImc = pimeui->hwndIMC;
816  if (pimeui->fShowStatus)
817  {
818  if (hwndOldImc && hwndNewImc && hwndOldImc != hwndNewImc &&
819  IntGetTopLevelWindow(hwndOldImc) != IntGetTopLevelWindow(hwndNewImc))
820  {
821  User32NotifyOpenStatus(pimeui, hwndOldImc, FALSE);
822  User32NotifyOpenStatus(pimeui, hwndNewImc, TRUE);
823  }
824  }
825  else
826  {
827  if (ValidateHwnd(hwndNewImc))
828  User32NotifyOpenStatus(pimeui, hwndNewImc, TRUE);
829  }
830  }
831 
832  pImeWnd = pimeui->spwnd;
833  hImeWnd = (pImeWnd ? UserHMGetHandle(pImeWnd) : NULL);
834  if (hImeWnd)
836  }
837  else
838  {
839  pImeWnd = pimeui->spwnd;
840  hImeWnd = UserHMGetHandle(pImeWnd);
841  hwndActive = (HWND)NtUserQueryWindow(hImeWnd, QUERY_WINDOW_ACTIVE);
842  if (!pwndFocus || !hwndActive || pImeWnd->head.pti != pwndFocus->head.pti)
843  {
844  if (IsWindow(hwndOldImc))
845  {
846  User32NotifyOpenStatus(pimeui, hwndOldImc, FALSE);
847  }
848  else
849  {
850  pimeui->fShowStatus = FALSE;
852  }
853  }
854  }
855 
856  return ret;
857 }
858 
859 // Win: ImeWndProcWorker(hwnd, msg, wParam, lParam, !unicode)
862 {
863  PWND pWnd;
864  PIMEUI pimeui;
865 
866  pWnd = ValidateHwnd(hwnd);
867  if (pWnd)
868  {
869  if (!pWnd->fnid)
870  {
871  if (msg != WM_NCCREATE)
872  {
873  if (unicode)
874  return DefWindowProcW(hwnd, msg, wParam, lParam);
875  return DefWindowProcA(hwnd, msg, wParam, lParam);
876  }
878  pimeui = HeapAlloc( GetProcessHeap(), 0, sizeof(IMEUI) );
879  pimeui->spwnd = pWnd;
881  }
882  else
883  {
884  if (pWnd->fnid != FNID_IME)
885  {
886  ERR("Wrong window class for Ime! fnId 0x%x\n",pWnd->fnid);
887  return 0;
888  }
889  pimeui = ((PIMEWND)pWnd)->pimeui;
890  if (pimeui == NULL)
891  {
892  ERR("Window is not set to IME!\n");
893  return 0;
894  }
895  }
896  }
897 
898  if (pimeui->nCntInIMEProc > 0)
899  {
900  switch (msg)
901  {
902  case WM_IME_CHAR:
904  case WM_IME_CONTROL:
905  case WM_IME_NOTIFY:
906  case WM_IME_REQUEST:
907  case WM_IME_SELECT:
908  case WM_IME_SETCONTEXT:
909  case WM_IME_STARTCOMPOSITION:
910  case WM_IME_COMPOSITION:
911  case WM_IME_ENDCOMPOSITION:
912  return 0;
913 
914  case WM_IME_SYSTEM:
915  switch (wParam)
916  {
917  case 0x03:
918  case 0x10:
919  case 0x13:
920  break;
921 
922  default:
923  return 0;
924  }
925  break;
926 
927  default:
928  {
929  if (unicode)
930  return DefWindowProcW(hwnd, msg, wParam, lParam);
931  return DefWindowProcA(hwnd, msg, wParam, lParam);
932  }
933  }
934  }
935 
936  switch (msg)
937  {
938  case WM_CREATE:
939  return (ImeWnd_OnCreate(pimeui, (LPCREATESTRUCT)lParam) ? 0 : -1);
940 
941  case WM_DESTROY:
942  User32DestroyImeUIWindow(pimeui);
943  break;
944 
945  case WM_NCDESTROY:
946  HeapFree(GetProcessHeap(), 0, pimeui);
949  break;
950 
951  case WM_ERASEBKGND:
952  return TRUE;
953 
954  case WM_PAINT:
955  break;
956 
957  case WM_COPYDATA:
958  // TODO:
959  break;
960 
961  case WM_IME_STARTCOMPOSITION:
962  case WM_IME_COMPOSITION:
963  case WM_IME_ENDCOMPOSITION:
964  return User32SendImeUIMessage(pimeui, msg, wParam, lParam, unicode);
965 
966  case WM_IME_CONTROL:
967  return ImeWnd_OnImeControl(pimeui, wParam, lParam, unicode);
968 
969  case WM_IME_NOTIFY:
970  return ImeWnd_OnImeNotify(pimeui, wParam, lParam);
971 
972  case WM_IME_REQUEST:
973  break;
974 
975  case WM_IME_SELECT:
976  ImeWnd_OnImeSelect(pimeui, wParam, lParam);
977  break;
978 
979  case WM_IME_SETCONTEXT:
980  return ImeWnd_OnImeSetContext(pimeui, wParam, lParam);
981 
982  case WM_IME_SYSTEM:
983  return ImeWnd_OnImeSystem(pimeui, wParam, lParam);
984 
985  default:
986  {
987  if (unicode)
988  return DefWindowProcW(hwnd, msg, wParam, lParam);
989  return DefWindowProcA(hwnd, msg, wParam, lParam);
990  }
991  }
992 
993  return 0;
994 }
995 
996 // Win: ImeWndProcA
998 {
1000 }
1001 
1002 // Win: ImeWndProcW
1004 {
1006 }
1007 
1008 // Win: UpdatePerUserImmEnabling
1010 {
1011  HMODULE imm32;
1012  BOOL ret;
1013 
1015  if (!ret || !(gpsi->dwSRVIFlags & SRVINFO_IMM32))
1016  return FALSE;
1017 
1018  imm32 = GetModuleHandleW(L"imm32.dll");
1019  if (imm32)
1020  return TRUE;
1021 
1022  imm32 = LoadLibraryW(L"imm32.dll");
1023  if (imm32)
1024  {
1025  ERR("UPUIE: Imm32 not installed!\n");
1026  ret = FALSE;
1027  }
1028 
1029  return ret;
1030 }
1031 
1032 BOOL
1033 WINAPI
1035 {
1036  ATOM atom;
1037  WNDCLASSEXW WndClass = { sizeof(WndClass) };
1038 
1039  WndClass.lpszClassName = L"IME";
1040  WndClass.style = CS_GLOBALCLASS;
1041  WndClass.lpfnWndProc = ImeWndProcW;
1042  WndClass.cbWndExtra = sizeof(LONG_PTR);
1043  WndClass.hCursor = LoadCursorW(NULL, IDC_ARROW);
1044 
1045  atom = RegisterClassExWOWW(&WndClass, 0, FNID_IME, 0, FALSE);
1046  if (!atom)
1047  {
1048  ERR("Failed to register IME Class!\n");
1049  return FALSE;
1050  }
1051 
1053  TRACE("RegisterIMEClass atom = %u\n", atom);
1054  return TRUE;
1055 }
1056 
1057 /*
1058  * @implemented
1059  */
1060 BOOL
1061 WINAPI
1063 {
1064  return IMM_FN(ImmIMPSetIMEW)(hwnd, ime);
1065 }
1066 
1067 /*
1068  * @implemented
1069  */
1070 BOOL
1071 WINAPI
1073 {
1074  return IMM_FN(ImmIMPQueryIMEW)(ime);
1075 }
1076 
1077 /*
1078  * @implemented
1079  */
1080 BOOL
1081 WINAPI
1083 {
1084  return IMM_FN(ImmIMPGetIMEW)(hwnd, ime);
1085 }
1086 
1087 /*
1088  * @implemented
1089  */
1090 BOOL
1091 WINAPI
1093 {
1094  return IMM_FN(ImmIMPSetIMEA)(hwnd, ime);
1095 }
1096 
1097 /*
1098  * @implemented
1099  */
1100 BOOL
1101 WINAPI
1103 {
1104  return IMM_FN(ImmIMPQueryIMEA)(ime);
1105 }
1106 
1107 /*
1108  * @implemented
1109  */
1110 BOOL
1111 WINAPI
1113 {
1114  return IMM_FN(ImmIMPGetIMEA)(hwnd, ime);
1115 }
1116 
1117 /*
1118  * @implemented
1119  */
1120 LRESULT
1121 WINAPI
1123 {
1125 }
1126 
1127 /*
1128  * @implemented
1129  */
1130 LRESULT
1131 WINAPI
1133 {
1135 }
1136 
1137 /*
1138  * @implemented
1139  */
1140 BOOL
1141 WINAPI
1143 {
1144  return IMM_FN(ImmWINNLSEnableIME)(hwnd, enable);
1145 }
1146 
1147 /*
1148  * @implemented
1149  */
1150 BOOL
1151 WINAPI
1153 {
1155 }
1156 
1157 /*
1158  * @implemented
1159  */
1160 UINT
1161 WINAPI
1163 {
1164  return FALSE;
1165 }
VOID WINAPI ImmUnlockImeDpi(PIMEDPI pImeDpi)
Definition: ime.c:758
#define WS_DISABLED
Definition: pedump.c:621
static BOOL User32CanSetImeWindowToImc(HIMC hIMC, HWND hImeWnd)
Definition: imm.c:155
UINT WINAPI WINNLSGetIMEHotkey(HWND hwnd)
Definition: imm.c:1162
#define WM_IME_NOTIFY
Definition: winuser.h:1817
#define LONG_PTR
Definition: treelist.c:79
static VOID User32NotifyOpenStatus(PIMEUI pimeui, HWND hwndIMC, BOOL bOpen)
Definition: imm.c:198
#define IMC_GETCOMPOSITIONFONT
Definition: imm.h:280
DWORD dwUIFlags
Definition: immdev.h:109
#define IMN_CLOSESTATUSWINDOW
Definition: imm.h:521
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:232
BOOL WINAPI ImmSetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: ime.c:1380
#define IMN_OPENSTATUSWINDOW
Definition: imm.h:522
#define WideCharToMultiByte
Definition: compat.h:111
#define WM_IME_CHAR
Definition: winuser.h:1821
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define IMC_SETCANDIDATEPOS
Definition: imm.h:279
BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
Definition: ime.c:1144
#define _Out_
Definition: ms_sal.h:345
static LRESULT ImeWnd_OnImeNotify(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
Definition: imm.c:244
WORD ATOM
Definition: dimm.idl:113
BOOL WINAPI ImmGetCompositionFontA(HIMC hIMC, LPLOGFONTA lplf)
Definition: ime.c:1307
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
#define IMC_SETCOMPOSITIONFONT
Definition: imm.h:281
#define MAX_CANDIDATEFORM
Definition: imm.c:17
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMS_IMEACTIVATE
Definition: immdev.h:28
LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC hIMC)
Definition: imm.c:1023
#define CP_ACP
Definition: compat.h:109
BOOL WINAPI IMPGetIMEA(HWND hwnd, LPIMEPROA ime)
Definition: imm.c:1112
char CHAR
Definition: xmlstorage.h:175
Definition: ntuser.h:190
#define INT
Definition: polytest.cpp:20
BOOL WINAPI ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType, PVOID pvSearchKey)
Definition: ime.c:686
PSERVERINFO gpsi
Definition: imm.c:17
HWND hWnd
Definition: settings.c:17
DWORD NTAPI NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
Definition: ime.c:809
HKL hKL
Definition: ntuser.h:1210
HANDLE HWND
Definition: compat.h:19
#define WM_IME_SELECT
Definition: winuser.h:1820
PWND spwnd
Definition: ntuser.h:1207
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
u32_t magic(void)
BOOL WINAPI ImmLoadIME(HKL hKL)
Definition: ime.c:806
LRESULT WINAPI ImeWndProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:1003
BOOL WINAPI WINNLSEnableIME(HWND hwnd, BOOL enable)
Definition: imm.c:1142
static LRESULT User32SendImeUIMessage(PIMEUI pimeui, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: imm.c:169
#define IMC_GETCONVERSIONMODE
Definition: immdev.h:21
DWORD dwStyle
Definition: dimm.idl:80
LONG nCntInIMEProc
Definition: ntuser.h:1212
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI IMPSetIMEW(HWND hwnd, LPIMEPROW ime)
Definition: imm.c:1062
#define WS_CHILD
Definition: pedump.c:617
#define GetWin32ClientInfo()
Definition: ntuser.h:335
HRESULT User32GetImmFileName(_Out_ LPWSTR lpBuffer, _In_ size_t cchBuffer)
Definition: imm.c:57
#define GetWindowLongPtrW
Definition: winuser.h:4809
LRESULT WINAPI ImeWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: imm.c:861
WORD WINAPI ImmSendIMEMessageExA(HWND hWnd, LPARAM lParam)
Definition: win3.c:210
DWORD fdwConversion
Definition: immdev.h:43
BOOL WINAPI ImmGetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
Definition: ime.c:1343
#define FNID_DESTROY
Definition: ntuser.h:877
HIMC hImc
Definition: ntuser.h:719
BOOL WINAPI ImmGetCandidateWindow(HIMC hIMC, DWORD dwIndex, LPCANDIDATEFORM lpCandidate)
Definition: candidate.c:359
static VOID User32SetImeWindowOfImc(HIMC hIMC, HWND hImeWnd)
Definition: imm.c:213
#define BOOL
Definition: nt_native.h:43
#define FASTCALL
Definition: nt_native.h:50
#define WM_NCCREATE
Definition: winuser.h:1670
BOOL WINAPI ImmSetConversionStatus(HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
Definition: ime.c:1627
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4296
#define DWORD
Definition: nt_native.h:44
#define WM_IME_COMPOSITIONFULL
Definition: winuser.h:1819
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI ImmRegisterClient(PSHAREDINFO ptr, HINSTANCE hMod)
Definition: imm.c:44
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendIMEMessageExA(HWND hwnd, LPARAM lParam)
Definition: imm.c:1132
BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
Definition: imm.c:1129
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
ATOM WINAPI RegisterClassExWOWW(WNDCLASSEXW *, LPDWORD, WORD, DWORD, BOOL)
Definition: class.c:1413
uint32_t ULONG_PTR
Definition: typedefs.h:65
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:4172
BOOL WINAPI ImmSetCompositionFontW(HIMC hIMC, LPLOGFONTW lplf)
Definition: ime.c:1437
#define L(x)
Definition: ntvdm.h:50
#define IMS_IMEDEACTIVATE
Definition: immdev.h:29
#define QUERY_WINDOW_FOCUS
Definition: ntuser.h:2922
#define IMN_SETOPENSTATUS
Definition: imm.h:528
#define IMC_GETSTATUSWINDOWPOS
Definition: imm.h:284
#define FALSE
Definition: types.h:117
DWORD dwSRVIFlags
Definition: ntuser.h:1022
HINSTANCE hInst
Definition: ntuser.h:1251
DWORD fnid
Definition: ntuser.h:688
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen)
Definition: ime.c:1167
HWND hwndUI
Definition: ntuser.h:1211
BOOL WINAPI ImmIMPQueryIMEW(LPIMEPROW pImePro)
Definition: utils.c:1083
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
static DWORD cchBuffer
Definition: fusion.c:85
BOOL WINAPI ImmFreeLayout(DWORD dwUnknown)
Definition: imm.c:117
BOOL WINAPI ImmIMPSetIMEA(HWND hWnd, LPIMEPROA pImePro)
Definition: utils.c:1092
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4295
BOOL NTAPI NtUserCallHwndLock(HWND hWnd, DWORD Routine)
Definition: simplecall.c:581
static VOID User32DestroyImeUIWindow(PIMEUI pimeui)
Definition: imm.c:373
THRDESKHEAD head
Definition: ntuser.h:674
BOOL NTAPI NtUserSetImeOwnerWindow(HWND hImeWnd, HWND hwndFocus)
Definition: ime.c:1344
#define LoadLibraryW(x)
Definition: compat.h:606
BOOL WINAPI User32InitializeImmEntryTable(DWORD)
Definition: imm.c:126
BOOLEAN NTAPI NtUserDestroyWindow(HWND Wnd)
Definition: window.c:3010
BOOL WINAPI GetClassInfoW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSW)
#define _In_
Definition: ms_sal.h:308
BOOL WINAPI InitializeImmEntryTable(VOID)
Definition: imm.c:119
BOOL WINAPI ImmGetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: ime.c:1256
LONG_PTR LPARAM
Definition: windef.h:208
#define IMC_CLOSESTATUSWINDOW
Definition: imm.h:286
LRESULT ImeWnd_OnImeSetContext(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
Definition: imm.c:706
UINT fDestroy
Definition: ntuser.h:1216
BOOL gbImmInitializing
Definition: imm.c:22
#define WM_IME_REQUEST
Definition: winuser.h:1823
#define WM_IME_SYSTEM
Definition: undocuser.h:59
DWORD HIMC
Definition: dimm.idl:75
BOOL WINAPI IMPGetIMEW(HWND hwnd, LPIMEPROW ime)
Definition: imm.c:1082
#define IMC_GETCOMPOSITIONWINDOW
Definition: imm.h:282
#define WM_DESTROY
Definition: winuser.h:1596
#define IME_PROP_UNICODE
Definition: imm.h:393
LRESULT WINAPI ImeWndProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: imm.c:997
#define UserHMGetHandle(obj)
Definition: ntuser.h:222
#define WM_COPYDATA
Definition: winuser.h:1651
Imm32ApiTable gImmApiEntries
Definition: imm.c:47
#define TRACE(s)
Definition: solgame.cpp:4
#define QUERY_WINDOW_ACTIVE
Definition: ntuser.h:2921
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IMC_SETCONVERSIONMODE
Definition: imm.h:221
#define ASSERT(a)
Definition: mode.c:44
#define IMMGWLP_IMC
Definition: immdev.h:35
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
DWORD fdwProperty
Definition: imm.h:158
#define WM_IME_SETCONTEXT
Definition: winuser.h:1816
#define _countof(array)
Definition: sndvol32.h:68
static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
Definition: imm.c:556
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1010
HIMC hIMC
Definition: ntuser.h:1208
#define WM_IME_CONTROL
Definition: winuser.h:1818
PIMEDPI WINAPI ImmLockImeDpi(HKL hKL)
Definition: ime.c:729
#define CS_GLOBALCLASS
Definition: winuser.h:647
#define WM_NCDESTROY
Definition: winuser.h:1671
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
BOOL WINAPI ImmIMPGetIMEW(HWND hWnd, LPIMEPROW pImePro)
Definition: utils.c:1065
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hImeWnd
Definition: ntuser.h:195
#define IMC_SETSTATUSWINDOWPOS
Definition: imm.h:285
WCHAR wszUIClass[16]
Definition: ntuser.h:1180
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
WORD WINAPI ImmSendIMEMessageExW(HWND hWnd, LPARAM lParam)
Definition: win3.c:219
#define IMC_GETSOFTKBDPOS
Definition: immdev.h:24
#define WM_PAINT
Definition: winuser.h:1607
SHAREDINFO gSharedInfo
Definition: imm.c:18
static BOOL User32GetImeShowStatus(VOID)
Definition: imm.c:162
#define IMC_GETCANDIDATEPOS
Definition: imm.h:278
#define IMC_OPENSTATUSWINDOW
Definition: imm.h:287
#define IMS_ACTIVATELAYOUT
Definition: immdev.h:30
int ret
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define ICLS_IME
Definition: ntuser.h:906
#define InterlockedDecrement
Definition: armddk.h:52
static VOID FASTCALL User32SetImeActivenessOfWindow(HWND hWnd, BOOL bActive)
Definition: imm.c:540
BOOL WINAPI ImmIMPSetIMEW(HWND hWnd, LPIMEPROW pImePro)
Definition: utils.c:1101
#define IMN_PRIVATE
Definition: imm.h:534
WINE_DEFAULT_DEBUG_CHANNEL(imm)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT_PTR HKL
Definition: msctf.idl:101
#define IMC_SETSENTENCEMODE
Definition: imm.h:222
BOOL WINAPI ImmConfigureIMEW(HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData)
Definition: ime.c:1740
static VOID User32UpdateImcOfImeUI(PIMEUI pimeui, HIMC hNewIMC)
Definition: imm.c:223
BOOL WINAPI ImmWINNLSGetEnableStatus(HWND hWnd)
Definition: imm.c:1225
DWORD NTAPI NtUserCallHwndParamLock(HWND hWnd, DWORD_PTR Param, DWORD Routine)
Definition: simplecall.c:880
BOOL WINAPI ImmSetStatusWindowPos(HIMC hIMC, LPPOINT lpptPos)
Definition: ime.c:1228
DWORD_PTR NTAPI NtUserCallNoParam(DWORD Routine)
Definition: simplecall.c:59
BOOL WINAPI IMPQueryIMEW(LPIMEPROW ime)
Definition: imm.c:1072
static BOOL IntInitializeImmEntryTable(VOID)
Definition: imm.c:70
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1051
LRESULT WINAPI ImmSystemHandler(HIMC hIMC, WPARAM wParam, LPARAM lParam)
Definition: keymsg.c:754
#define ERR(fmt,...)
Definition: debug.h:110
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:672
HINSTANCE ghImm32
Definition: imm.c:20
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI ImmGetConversionStatus(HIMC hIMC, LPDWORD lpfdwConversion, LPDWORD lpfdwSentence)
Definition: ime.c:1605
struct _IMEWND * PIMEWND
BOOL WINAPI WINNLSGetEnableStatus(HWND hwnd)
Definition: imm.c:1152
static HWND User32CreateImeUIWindow(PIMEUI pimeui, HKL hKL)
Definition: imm.c:294
GLboolean enable
Definition: glext.h:11120
IMEINFO ImeInfo
Definition: ntuser.h:1179
BOOL WINAPI IMPQueryIMEA(LPIMEPROA ime)
Definition: imm.c:1102
#define InterlockedIncrement
Definition: armddk.h:53
BOOL WINAPI RegisterIMEClass(VOID)
Definition: imm.c:1034
BOOL NTAPI NtUserUpdateInputContext(HIMC hIMC, DWORD dwType, DWORD_PTR dwValue)
Definition: ime.c:1744
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IMN_SETCONVERSIONMODE
Definition: imm.h:526
DWORD state
Definition: ntuser.h:680
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IMC_SETOPENSTATUS
Definition: imm.h:223
static BOOL ImeWnd_OnCreate(PIMEUI pimeui, LPCREATESTRUCT lpCS)
Definition: imm.c:339
#define IMMGWL_IMC
Definition: immdev.h:32
#define WS_POPUP
Definition: pedump.c:616
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define IME_CONFIG_GENERAL
Definition: imm.h:553
#define GW_OWNER
Definition: winuser.h:761
UINT fShowStatus
Definition: ntuser.h:1214
BOOL WINAPI UpdatePerUserImmEnabling(VOID)
Definition: imm.c:1009
static VOID ImeWnd_OnImeSelect(PIMEUI pimeui, WPARAM wParam, LPARAM lParam)
Definition: imm.c:388
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
HINSTANCE hInstance
Definition: winuser.h:3160
BOOL WINAPI ImmIMPQueryIMEA(LPIMEPROA pImePro)
Definition: utils.c:1074
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
BOOL WINAPI ImmSetCandidateWindow(HIMC hIMC, LPCANDIDATEFORM lpCandidate)
Definition: candidate.c:385
BOOL WINAPI IMPSetIMEA(HWND hwnd, LPIMEPROA ime)
Definition: imm.c:1092
#define WM_CREATE
Definition: winuser.h:1595
#define SRVINFO_IMM32
Definition: ntuser.h:928
BOOL WINAPI ImmIMPGetIMEA(HWND hWnd, LPIMEPROA pImePro)
Definition: utils.c:1056
#define ICLASS_TO_MASK(iCls)
Definition: ntuser.h:881
DWORD state2
Definition: ntuser.h:681
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define IMC_SETCOMPOSITIONWINDOW
Definition: imm.h:283
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4327
LRESULT WINAPI SendIMEMessageExW(HWND hwnd, LPARAM lParam)
Definition: imm.c:1122
#define ULONG_PTR
Definition: config.h:101
#define IMM_INIT_MAGIC
Definition: imm.c:16
#define IMC_SETSOFTKBDPOS
Definition: immdev.h:25
UINT fCtrlShowStatus
Definition: ntuser.h:1219
#define SetWindowLongPtrW
Definition: winuser.h:5326
DWORD RegisterDefaultClasses
Definition: regcontrol.c:13
#define WM_ERASEBKGND
Definition: winuser.h:1612
#define IMC_GETOPENSTATUS
Definition: immdev.h:23
BOOL WINAPI ImmActivateLayout(HKL hKL)
Definition: imm.c:446
LPVOID FASTCALL ValidateHandle(HANDLE hObject, UINT uType)
Definition: utils.c:207
HWND hwndIMC
Definition: ntuser.h:1209
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IMC_GETSENTENCEMODE
Definition: immdev.h:22
BOOL WINAPI ImmSetCompositionWindow(HIMC hIMC, LPCOMPOSITIONFORM lpCompForm)
Definition: ime.c:1280
LONG_PTR LRESULT
Definition: windef.h:209
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
UINT fActivate
Definition: ntuser.h:1215
Arabic default style
Definition: afstyles.h:93
HWND FASTCALL IntGetTopLevelWindow(HWND hWnd)
Definition: imm.c:26
#define WNDS_DESTROYED
Definition: ntuser.h:619
BOOL WINAPI ImmUnlockIMC(HIMC hIMC)
Definition: imm.c:1032
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
DWORD dwStyle
Definition: dimm.idl:86
LONG NTAPI NtUserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
Definition: window.c:4028
#define HeapFree(x, y, z)
Definition: compat.h:594
INT gfConIme
Definition: imm.c:24
WCHAR WndClass[]
Definition: capicon.c:23
#define WNDS2_INDESTROY
Definition: ntuser.h:631
#define FNID_IME
Definition: ntuser.h:853
static LRESULT ImeWnd_OnImeControl(PIMEUI pimeui, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: imm.c:419
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
#define IMM_FN(name)
Definition: user32p.h:56
DWORD style
Definition: ntuser.h:685