setupapi: Use SetupGetIntField() in SetupGetSourceFileLocation().
[wine.git] / dlls / msimtf / activeimmapp.c
blobf062ae269c2f8a185e32003b57edf346db8294ee
1 /*
2 * ActiveIMMApp Interface
4 * Copyright 2008 CodeWeavers, Aric Stewart
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "winreg.h"
29 #include "winuser.h"
30 #include "winerror.h"
31 #include "objbase.h"
32 #include "dimm.h"
33 #include "imm.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(msimtf);
39 typedef struct tagActiveIMMApp {
40 IActiveIMMApp IActiveIMMApp_iface;
41 IActiveIMMMessagePumpOwner IActiveIMMMessagePumpOwner_iface;
42 LONG refCount;
43 } ActiveIMMApp;
45 static inline ActiveIMMApp *impl_from_IActiveIMMApp(IActiveIMMApp *iface)
47 return CONTAINING_RECORD(iface, ActiveIMMApp, IActiveIMMApp_iface);
50 static void ActiveIMMApp_Destructor(ActiveIMMApp* This)
52 TRACE("\n");
53 HeapFree(GetProcessHeap(),0,This);
56 static HRESULT WINAPI ActiveIMMApp_QueryInterface (IActiveIMMApp* iface,
57 REFIID iid, LPVOID *ppvOut)
59 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
60 *ppvOut = NULL;
62 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IActiveIMMApp))
64 *ppvOut = &This->IActiveIMMApp_iface;
66 else if (IsEqualIID(iid, &IID_IActiveIMMMessagePumpOwner))
68 *ppvOut = &This->IActiveIMMMessagePumpOwner_iface;
71 if (*ppvOut)
73 IUnknown_AddRef(iface);
74 return S_OK;
77 WARN("unsupported interface: %s\n", debugstr_guid(iid));
78 return E_NOINTERFACE;
81 static ULONG WINAPI ActiveIMMApp_AddRef(IActiveIMMApp* iface)
83 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
84 return InterlockedIncrement(&This->refCount);
87 static ULONG WINAPI ActiveIMMApp_Release(IActiveIMMApp* iface)
89 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface);
90 ULONG ret;
92 ret = InterlockedDecrement(&This->refCount);
93 if (ret == 0)
94 ActiveIMMApp_Destructor(This);
95 return ret;
98 static HRESULT WINAPI ActiveIMMApp_AssociateContext(IActiveIMMApp* iface,
99 HWND hWnd, HIMC hIME, HIMC *phPrev)
101 *phPrev = ImmAssociateContext(hWnd,hIME);
102 return S_OK;
105 static HRESULT WINAPI ActiveIMMApp_ConfigureIMEA(IActiveIMMApp* This,
106 HKL hKL, HWND hwnd, DWORD dwMode, REGISTERWORDA *pData)
108 BOOL rc;
110 rc = ImmConfigureIMEA(hKL, hwnd, dwMode, pData);
111 if (rc)
112 return E_FAIL;
113 else
114 return S_OK;
117 static HRESULT WINAPI ActiveIMMApp_ConfigureIMEW(IActiveIMMApp* This,
118 HKL hKL, HWND hWnd, DWORD dwMode, REGISTERWORDW *pData)
120 BOOL rc;
122 rc = ImmConfigureIMEW(hKL, hWnd, dwMode, pData);
123 if (rc)
124 return E_FAIL;
125 else
126 return S_OK;
129 static HRESULT WINAPI ActiveIMMApp_CreateContext(IActiveIMMApp* This,
130 HIMC *phIMC)
132 *phIMC = ImmCreateContext();
133 if (*phIMC)
134 return S_OK;
135 else
136 return E_FAIL;
139 static HRESULT WINAPI ActiveIMMApp_DestroyContext(IActiveIMMApp* This,
140 HIMC hIME)
142 BOOL rc;
144 rc = ImmDestroyContext(hIME);
145 if (rc)
146 return S_OK;
147 else
148 return E_FAIL;
151 static HRESULT WINAPI ActiveIMMApp_EnumRegisterWordA(IActiveIMMApp* This,
152 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szRegister,
153 LPVOID pData, IEnumRegisterWordA **pEnum)
155 FIXME("Stub\n");
156 return E_NOTIMPL;
159 static HRESULT WINAPI ActiveIMMApp_EnumRegisterWordW(IActiveIMMApp* This,
160 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister,
161 LPVOID pData, IEnumRegisterWordW **pEnum)
163 FIXME("Stub\n");
164 return E_NOTIMPL;
167 static HRESULT WINAPI ActiveIMMApp_EscapeA(IActiveIMMApp* This,
168 HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT *plResult)
170 *plResult = ImmEscapeA(hKL, hIMC, uEscape, pData);
171 return S_OK;
174 static HRESULT WINAPI ActiveIMMApp_EscapeW(IActiveIMMApp* This,
175 HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT *plResult)
177 *plResult = ImmEscapeW(hKL, hIMC, uEscape, pData);
178 return S_OK;
181 static HRESULT WINAPI ActiveIMMApp_GetCandidateListA(IActiveIMMApp* This,
182 HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST *pCandList,
183 UINT *puCopied)
185 *puCopied = ImmGetCandidateListA(hIMC, dwIndex, pCandList, uBufLen);
186 return S_OK;
189 static HRESULT WINAPI ActiveIMMApp_GetCandidateListW(IActiveIMMApp* This,
190 HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST *pCandList,
191 UINT *puCopied)
193 *puCopied = ImmGetCandidateListW(hIMC, dwIndex, pCandList, uBufLen);
194 return S_OK;
197 static HRESULT WINAPI ActiveIMMApp_GetCandidateListCountA(IActiveIMMApp* This,
198 HIMC hIMC, DWORD *pdwListSize, DWORD *pdwBufLen)
200 *pdwBufLen = ImmGetCandidateListCountA(hIMC, pdwListSize);
201 return S_OK;
204 static HRESULT WINAPI ActiveIMMApp_GetCandidateListCountW(IActiveIMMApp* This,
205 HIMC hIMC, DWORD *pdwListSize, DWORD *pdwBufLen)
207 *pdwBufLen = ImmGetCandidateListCountA(hIMC, pdwListSize);
208 return S_OK;
211 static HRESULT WINAPI ActiveIMMApp_GetCandidateWindow(IActiveIMMApp* This,
212 HIMC hIMC, DWORD dwIndex, CANDIDATEFORM *pCandidate)
214 BOOL rc;
215 rc = ImmGetCandidateWindow(hIMC,dwIndex,pCandidate);
216 if (rc)
217 return S_OK;
218 else
219 return E_FAIL;
222 static HRESULT WINAPI ActiveIMMApp_GetCompositionFontA(IActiveIMMApp* This,
223 HIMC hIMC, LOGFONTA *plf)
225 BOOL rc;
226 rc = ImmGetCompositionFontA(hIMC,plf);
227 if (rc)
228 return S_OK;
229 else
230 return E_FAIL;
233 static HRESULT WINAPI ActiveIMMApp_GetCompositionFontW(IActiveIMMApp* This,
234 HIMC hIMC, LOGFONTW *plf)
236 BOOL rc;
237 rc = ImmGetCompositionFontW(hIMC,plf);
238 if (rc)
239 return S_OK;
240 else
241 return E_FAIL;
244 static HRESULT WINAPI ActiveIMMApp_GetCompositionStringA(IActiveIMMApp* This,
245 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG *plCopied, LPVOID pBuf)
247 *plCopied = ImmGetCompositionStringA(hIMC, dwIndex, pBuf, dwBufLen);
248 return S_OK;
251 static HRESULT WINAPI ActiveIMMApp_GetCompositionStringW(IActiveIMMApp* This,
252 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG *plCopied, LPVOID pBuf)
254 *plCopied = ImmGetCompositionStringW(hIMC, dwIndex, pBuf, dwBufLen);
255 return S_OK;
258 static HRESULT WINAPI ActiveIMMApp_GetCompositionWindow(IActiveIMMApp* This,
259 HIMC hIMC, COMPOSITIONFORM *pCompForm)
261 BOOL rc;
263 rc = ImmGetCompositionWindow(hIMC,pCompForm);
265 if (rc)
266 return S_OK;
267 else
268 return E_FAIL;
271 static HRESULT WINAPI ActiveIMMApp_GetContext(IActiveIMMApp* This,
272 HWND hwnd, HIMC *phIMC)
274 *phIMC = ImmGetContext(hwnd);
275 return S_OK;
278 static HRESULT WINAPI ActiveIMMApp_GetConversionListA(IActiveIMMApp* This,
279 HKL hKL, HIMC hIMC, LPSTR pSrc, UINT uBufLen, UINT uFlag,
280 CANDIDATELIST *pDst, UINT *puCopied)
282 *puCopied = ImmGetConversionListA(hKL, hIMC, pSrc, pDst, uBufLen, uFlag);
283 return S_OK;
286 static HRESULT WINAPI ActiveIMMApp_GetConversionListW(IActiveIMMApp* This,
287 HKL hKL, HIMC hIMC, LPWSTR pSrc, UINT uBufLen, UINT uFlag,
288 CANDIDATELIST *pDst, UINT *puCopied)
290 *puCopied = ImmGetConversionListW(hKL, hIMC, pSrc, pDst, uBufLen, uFlag);
291 return S_OK;
294 static HRESULT WINAPI ActiveIMMApp_GetConversionStatus(IActiveIMMApp* This,
295 HIMC hIMC, DWORD *pfdwConversion, DWORD *pfdwSentence)
297 BOOL rc;
299 rc = ImmGetConversionStatus(hIMC, pfdwConversion, pfdwSentence);
301 if (rc)
302 return S_OK;
303 else
304 return E_FAIL;
307 static HRESULT WINAPI ActiveIMMApp_GetDefaultIMEWnd(IActiveIMMApp* This,
308 HWND hWnd, HWND *phDefWnd)
310 *phDefWnd = ImmGetDefaultIMEWnd(hWnd);
311 return S_OK;
314 static HRESULT WINAPI ActiveIMMApp_GetDescriptionA(IActiveIMMApp* This,
315 HKL hKL, UINT uBufLen, LPSTR szDescription, UINT *puCopied)
317 *puCopied = ImmGetDescriptionA(hKL, szDescription, uBufLen);
318 return S_OK;
321 static HRESULT WINAPI ActiveIMMApp_GetDescriptionW(IActiveIMMApp* This,
322 HKL hKL, UINT uBufLen, LPWSTR szDescription, UINT *puCopied)
324 *puCopied = ImmGetDescriptionW(hKL, szDescription, uBufLen);
325 return S_OK;
328 static HRESULT WINAPI ActiveIMMApp_GetGuideLineA(IActiveIMMApp* This,
329 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPSTR pBuf,
330 DWORD *pdwResult)
332 *pdwResult = ImmGetGuideLineA(hIMC, dwIndex, pBuf, dwBufLen);
333 return S_OK;
336 static HRESULT WINAPI ActiveIMMApp_GetGuideLineW(IActiveIMMApp* This,
337 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPWSTR pBuf,
338 DWORD *pdwResult)
340 *pdwResult = ImmGetGuideLineW(hIMC, dwIndex, pBuf, dwBufLen);
341 return S_OK;
344 static HRESULT WINAPI ActiveIMMApp_GetIMEFileNameA(IActiveIMMApp* This,
345 HKL hKL, UINT uBufLen, LPSTR szFileName, UINT *puCopied)
347 *puCopied = ImmGetIMEFileNameA(hKL, szFileName, uBufLen);
348 return S_OK;
351 static HRESULT WINAPI ActiveIMMApp_GetIMEFileNameW(IActiveIMMApp* This,
352 HKL hKL, UINT uBufLen, LPWSTR szFileName, UINT *puCopied)
354 *puCopied = ImmGetIMEFileNameW(hKL, szFileName, uBufLen);
355 return S_OK;
358 static HRESULT WINAPI ActiveIMMApp_GetOpenStatus(IActiveIMMApp* This,
359 HIMC hIMC)
361 return ImmGetOpenStatus(hIMC);
364 static HRESULT WINAPI ActiveIMMApp_GetProperty(IActiveIMMApp* This,
365 HKL hKL, DWORD fdwIndex, DWORD *pdwProperty)
367 *pdwProperty = ImmGetProperty(hKL, fdwIndex);
368 return S_OK;
371 static HRESULT WINAPI ActiveIMMApp_GetRegisterWordStyleA(IActiveIMMApp* This,
372 HKL hKL, UINT nItem, STYLEBUFA *pStyleBuf, UINT *puCopied)
374 *puCopied = ImmGetRegisterWordStyleA(hKL, nItem, pStyleBuf);
375 return S_OK;
378 static HRESULT WINAPI ActiveIMMApp_GetRegisterWordStyleW(IActiveIMMApp* This,
379 HKL hKL, UINT nItem, STYLEBUFW *pStyleBuf, UINT *puCopied)
381 *puCopied = ImmGetRegisterWordStyleW(hKL, nItem, pStyleBuf);
382 return S_OK;
385 static HRESULT WINAPI ActiveIMMApp_GetStatusWindowPos(IActiveIMMApp* This,
386 HIMC hIMC, POINT *pptPos)
388 BOOL rc;
389 rc = ImmGetStatusWindowPos(hIMC, pptPos);
391 if (rc)
392 return S_OK;
393 else
394 return E_FAIL;
397 static HRESULT WINAPI ActiveIMMApp_GetVirtualKey(IActiveIMMApp* This,
398 HWND hWnd, UINT *puVirtualKey)
400 *puVirtualKey = ImmGetVirtualKey(hWnd);
401 return S_OK;
404 static HRESULT WINAPI ActiveIMMApp_InstallIMEA(IActiveIMMApp* This,
405 LPSTR szIMEFileName, LPSTR szLayoutText, HKL *phKL)
407 *phKL = ImmInstallIMEA(szIMEFileName,szLayoutText);
408 return S_OK;
411 static HRESULT WINAPI ActiveIMMApp_InstallIMEW(IActiveIMMApp* This,
412 LPWSTR szIMEFileName, LPWSTR szLayoutText, HKL *phKL)
414 *phKL = ImmInstallIMEW(szIMEFileName,szLayoutText);
415 return S_OK;
418 static HRESULT WINAPI ActiveIMMApp_IsIME(IActiveIMMApp* This,
419 HKL hKL)
421 return ImmIsIME(hKL);
424 static HRESULT WINAPI ActiveIMMApp_IsUIMessageA(IActiveIMMApp* This,
425 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
427 return ImmIsUIMessageA(hWndIME,msg,wParam,lParam);
430 static HRESULT WINAPI ActiveIMMApp_IsUIMessageW(IActiveIMMApp* This,
431 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam)
433 return ImmIsUIMessageW(hWndIME,msg,wParam,lParam);
436 static HRESULT WINAPI ActiveIMMApp_NotifyIME(IActiveIMMApp* This,
437 HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue)
439 BOOL rc;
441 rc = ImmNotifyIME(hIMC,dwAction,dwIndex,dwValue);
443 if (rc)
444 return S_OK;
445 else
446 return E_FAIL;
449 static HRESULT WINAPI ActiveIMMApp_RegisterWordA(IActiveIMMApp* This,
450 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szRegister)
452 BOOL rc;
454 rc = ImmRegisterWordA(hKL,szReading,dwStyle,szRegister);
456 if (rc)
457 return S_OK;
458 else
459 return E_FAIL;
462 static HRESULT WINAPI ActiveIMMApp_RegisterWordW(IActiveIMMApp* This,
463 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister)
465 BOOL rc;
467 rc = ImmRegisterWordW(hKL,szReading,dwStyle,szRegister);
469 if (rc)
470 return S_OK;
471 else
472 return E_FAIL;
475 static HRESULT WINAPI ActiveIMMApp_ReleaseContext(IActiveIMMApp* This,
476 HWND hWnd, HIMC hIMC)
478 BOOL rc;
480 rc = ImmReleaseContext(hWnd,hIMC);
482 if (rc)
483 return S_OK;
484 else
485 return E_FAIL;
488 static HRESULT WINAPI ActiveIMMApp_SetCandidateWindow(IActiveIMMApp* This,
489 HIMC hIMC, CANDIDATEFORM *pCandidate)
491 BOOL rc;
493 rc = ImmSetCandidateWindow(hIMC,pCandidate);
495 if (rc)
496 return S_OK;
497 else
498 return E_FAIL;
501 static HRESULT WINAPI ActiveIMMApp_SetCompositionFontA(IActiveIMMApp* This,
502 HIMC hIMC, LOGFONTA *plf)
504 BOOL rc;
506 rc = ImmSetCompositionFontA(hIMC,plf);
508 if (rc)
509 return S_OK;
510 else
511 return E_FAIL;
514 static HRESULT WINAPI ActiveIMMApp_SetCompositionFontW(IActiveIMMApp* This,
515 HIMC hIMC, LOGFONTW *plf)
517 BOOL rc;
519 rc = ImmSetCompositionFontW(hIMC,plf);
521 if (rc)
522 return S_OK;
523 else
524 return E_FAIL;
527 static HRESULT WINAPI ActiveIMMApp_SetCompositionStringA(IActiveIMMApp* This,
528 HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen,
529 LPVOID pRead, DWORD dwReadLen)
531 BOOL rc;
533 rc = ImmSetCompositionStringA(hIMC,dwIndex,pComp,dwCompLen,pRead,dwReadLen);
535 if (rc)
536 return S_OK;
537 else
538 return E_FAIL;
541 static HRESULT WINAPI ActiveIMMApp_SetCompositionStringW(IActiveIMMApp* This,
542 HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen,
543 LPVOID pRead, DWORD dwReadLen)
545 BOOL rc;
547 rc = ImmSetCompositionStringW(hIMC,dwIndex,pComp,dwCompLen,pRead,dwReadLen);
549 if (rc)
550 return S_OK;
551 else
552 return E_FAIL;
555 static HRESULT WINAPI ActiveIMMApp_SetCompositionWindow(IActiveIMMApp* This,
556 HIMC hIMC, COMPOSITIONFORM *pCompForm)
558 BOOL rc;
560 rc = ImmSetCompositionWindow(hIMC,pCompForm);
562 if (rc)
563 return S_OK;
564 else
565 return E_FAIL;
568 static HRESULT WINAPI ActiveIMMApp_SetConversionStatus(IActiveIMMApp* This,
569 HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence)
571 BOOL rc;
573 rc = ImmSetConversionStatus(hIMC,fdwConversion,fdwSentence);
575 if (rc)
576 return S_OK;
577 else
578 return E_FAIL;
581 static HRESULT WINAPI ActiveIMMApp_SetOpenStatus(IActiveIMMApp* This,
582 HIMC hIMC, BOOL fOpen)
584 BOOL rc;
586 rc = ImmSetOpenStatus(hIMC,fOpen);
588 if (rc)
589 return S_OK;
590 else
591 return E_FAIL;
594 static HRESULT WINAPI ActiveIMMApp_SetStatusWindowPos(IActiveIMMApp* This,
595 HIMC hIMC, POINT *pptPos)
597 BOOL rc;
599 rc = ImmSetStatusWindowPos(hIMC,pptPos);
601 if (rc)
602 return S_OK;
603 else
604 return E_FAIL;
607 static HRESULT WINAPI ActiveIMMApp_SimulateHotKey(IActiveIMMApp* This,
608 HWND hwnd, DWORD dwHotKeyID)
610 BOOL rc;
612 rc = ImmSimulateHotKey(hwnd,dwHotKeyID);
614 if (rc)
615 return S_OK;
616 else
617 return E_FAIL;
620 static HRESULT WINAPI ActiveIMMApp_UnregisterWordA(IActiveIMMApp* This,
621 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szUnregister)
623 BOOL rc;
625 rc = ImmUnregisterWordA(hKL,szReading,dwStyle,szUnregister);
627 if (rc)
628 return S_OK;
629 else
630 return E_FAIL;
634 static HRESULT WINAPI ActiveIMMApp_UnregisterWordW(IActiveIMMApp* This,
635 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szUnregister)
637 BOOL rc;
639 rc = ImmUnregisterWordW(hKL,szReading,dwStyle,szUnregister);
641 if (rc)
642 return S_OK;
643 else
644 return E_FAIL;
647 static HRESULT WINAPI ActiveIMMApp_Activate(IActiveIMMApp* This,
648 BOOL fRestoreLayout)
650 FIXME("Stub\n");
651 return S_OK;
654 static HRESULT WINAPI ActiveIMMApp_Deactivate(IActiveIMMApp* This)
656 FIXME("Stub\n");
657 return S_OK;
660 static HRESULT WINAPI ActiveIMMApp_OnDefWindowProc(IActiveIMMApp* This,
661 HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult)
663 FIXME("Stub (%p %x %Ix %Ix)\n",hWnd,Msg,wParam,lParam);
664 return E_FAIL;
667 static HRESULT WINAPI ActiveIMMApp_FilterClientWindows(IActiveIMMApp* This,
668 ATOM *aaClassList, UINT uSize)
670 FIXME("Stub\n");
671 return S_OK;
674 static HRESULT WINAPI ActiveIMMApp_GetCodePageA(IActiveIMMApp* This,
675 HKL hKL, UINT *uCodePage)
677 FIXME("Stub\n");
678 return E_NOTIMPL;
681 static HRESULT WINAPI ActiveIMMApp_GetLangId(IActiveIMMApp* This,
682 HKL hKL, LANGID *plid)
684 FIXME("Stub\n");
685 return E_NOTIMPL;
688 static HRESULT WINAPI ActiveIMMApp_AssociateContextEx(IActiveIMMApp* This,
689 HWND hWnd, HIMC hIMC, DWORD dwFlags)
691 BOOL rc;
693 rc = ImmAssociateContextEx(hWnd,hIMC,dwFlags);
695 if (rc)
696 return S_OK;
697 else
698 return E_FAIL;
701 static HRESULT WINAPI ActiveIMMApp_DisableIME(IActiveIMMApp* This,
702 DWORD idThread)
704 BOOL rc;
706 rc = ImmDisableIME(idThread);
708 if (rc)
709 return S_OK;
710 else
711 return E_FAIL;
714 static HRESULT WINAPI ActiveIMMApp_GetImeMenuItemsA(IActiveIMMApp* This,
715 HIMC hIMC, DWORD dwFlags, DWORD dwType,
716 IMEMENUITEMINFOA *pImeParentMenu, IMEMENUITEMINFOA *pImeMenu,
717 DWORD dwSize, DWORD *pdwResult)
719 *pdwResult = ImmGetImeMenuItemsA(hIMC,dwFlags,dwType,pImeParentMenu,pImeMenu,dwSize);
720 return S_OK;
723 static HRESULT WINAPI ActiveIMMApp_GetImeMenuItemsW(IActiveIMMApp* This,
724 HIMC hIMC, DWORD dwFlags, DWORD dwType,
725 IMEMENUITEMINFOW *pImeParentMenu, IMEMENUITEMINFOW *pImeMenu,
726 DWORD dwSize, DWORD *pdwResult)
728 *pdwResult = ImmGetImeMenuItemsW(hIMC,dwFlags,dwType,pImeParentMenu,pImeMenu,dwSize);
729 return S_OK;
732 static HRESULT WINAPI ActiveIMMApp_EnumInputContext(IActiveIMMApp* This,
733 DWORD idThread, IEnumInputContext **ppEnum)
735 FIXME("Stub\n");
736 return E_NOTIMPL;
739 static const IActiveIMMAppVtbl ActiveIMMAppVtbl =
741 ActiveIMMApp_QueryInterface,
742 ActiveIMMApp_AddRef,
743 ActiveIMMApp_Release,
745 ActiveIMMApp_AssociateContext,
746 ActiveIMMApp_ConfigureIMEA,
747 ActiveIMMApp_ConfigureIMEW,
748 ActiveIMMApp_CreateContext,
749 ActiveIMMApp_DestroyContext,
750 ActiveIMMApp_EnumRegisterWordA,
751 ActiveIMMApp_EnumRegisterWordW,
752 ActiveIMMApp_EscapeA,
753 ActiveIMMApp_EscapeW,
754 ActiveIMMApp_GetCandidateListA,
755 ActiveIMMApp_GetCandidateListW,
756 ActiveIMMApp_GetCandidateListCountA,
757 ActiveIMMApp_GetCandidateListCountW,
758 ActiveIMMApp_GetCandidateWindow,
759 ActiveIMMApp_GetCompositionFontA,
760 ActiveIMMApp_GetCompositionFontW,
761 ActiveIMMApp_GetCompositionStringA,
762 ActiveIMMApp_GetCompositionStringW,
763 ActiveIMMApp_GetCompositionWindow,
764 ActiveIMMApp_GetContext,
765 ActiveIMMApp_GetConversionListA,
766 ActiveIMMApp_GetConversionListW,
767 ActiveIMMApp_GetConversionStatus,
768 ActiveIMMApp_GetDefaultIMEWnd,
769 ActiveIMMApp_GetDescriptionA,
770 ActiveIMMApp_GetDescriptionW,
771 ActiveIMMApp_GetGuideLineA,
772 ActiveIMMApp_GetGuideLineW,
773 ActiveIMMApp_GetIMEFileNameA,
774 ActiveIMMApp_GetIMEFileNameW,
775 ActiveIMMApp_GetOpenStatus,
776 ActiveIMMApp_GetProperty,
777 ActiveIMMApp_GetRegisterWordStyleA,
778 ActiveIMMApp_GetRegisterWordStyleW,
779 ActiveIMMApp_GetStatusWindowPos,
780 ActiveIMMApp_GetVirtualKey,
781 ActiveIMMApp_InstallIMEA,
782 ActiveIMMApp_InstallIMEW,
783 ActiveIMMApp_IsIME,
784 ActiveIMMApp_IsUIMessageA,
785 ActiveIMMApp_IsUIMessageW,
786 ActiveIMMApp_NotifyIME,
787 ActiveIMMApp_RegisterWordA,
788 ActiveIMMApp_RegisterWordW,
789 ActiveIMMApp_ReleaseContext,
790 ActiveIMMApp_SetCandidateWindow,
791 ActiveIMMApp_SetCompositionFontA,
792 ActiveIMMApp_SetCompositionFontW,
793 ActiveIMMApp_SetCompositionStringA,
794 ActiveIMMApp_SetCompositionStringW,
795 ActiveIMMApp_SetCompositionWindow,
796 ActiveIMMApp_SetConversionStatus,
797 ActiveIMMApp_SetOpenStatus,
798 ActiveIMMApp_SetStatusWindowPos,
799 ActiveIMMApp_SimulateHotKey,
800 ActiveIMMApp_UnregisterWordA,
801 ActiveIMMApp_UnregisterWordW,
803 ActiveIMMApp_Activate,
804 ActiveIMMApp_Deactivate,
805 ActiveIMMApp_OnDefWindowProc,
806 ActiveIMMApp_FilterClientWindows,
807 ActiveIMMApp_GetCodePageA,
808 ActiveIMMApp_GetLangId,
809 ActiveIMMApp_AssociateContextEx,
810 ActiveIMMApp_DisableIME,
811 ActiveIMMApp_GetImeMenuItemsA,
812 ActiveIMMApp_GetImeMenuItemsW,
813 ActiveIMMApp_EnumInputContext
816 static inline ActiveIMMApp *impl_from_IActiveIMMMessagePumpOwner(IActiveIMMMessagePumpOwner *iface)
818 return CONTAINING_RECORD(iface, ActiveIMMApp, IActiveIMMMessagePumpOwner_iface);
821 static HRESULT WINAPI ActiveIMMMessagePumpOwner_QueryInterface(IActiveIMMMessagePumpOwner* iface,
822 REFIID iid, LPVOID *ppvOut)
824 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
825 return IActiveIMMApp_QueryInterface(&This->IActiveIMMApp_iface, iid, ppvOut);
828 static ULONG WINAPI ActiveIMMMessagePumpOwner_AddRef(IActiveIMMMessagePumpOwner* iface)
830 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
831 return IActiveIMMApp_AddRef(&This->IActiveIMMApp_iface);
834 static ULONG WINAPI ActiveIMMMessagePumpOwner_Release(IActiveIMMMessagePumpOwner* iface)
836 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
837 return IActiveIMMApp_Release(&This->IActiveIMMApp_iface);
840 static HRESULT WINAPI ActiveIMMMessagePumpOwner_Start(IActiveIMMMessagePumpOwner* iface)
842 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
843 FIXME("(%p)->(): stub\n", This);
844 return E_NOTIMPL;
847 static HRESULT WINAPI ActiveIMMMessagePumpOwner_End(IActiveIMMMessagePumpOwner* iface)
849 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
850 FIXME("(%p)->(): stub\n", This);
851 return E_NOTIMPL;
854 static HRESULT WINAPI ActiveIMMMessagePumpOwner_OnTranslateMessage(IActiveIMMMessagePumpOwner* iface,
855 const MSG *msg)
857 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
858 FIXME("(%p)->(%p): stub\n", This, msg);
859 return E_NOTIMPL;
862 static HRESULT WINAPI ActiveIMMMessagePumpOwner_Pause(IActiveIMMMessagePumpOwner* iface,
863 DWORD *cookie)
865 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
866 FIXME("(%p)->(%p): stub\n", This, cookie);
867 return E_NOTIMPL;
870 static HRESULT WINAPI ActiveIMMMessagePumpOwner_Resume(IActiveIMMMessagePumpOwner* iface,
871 DWORD cookie)
873 ActiveIMMApp *This = impl_from_IActiveIMMMessagePumpOwner(iface);
874 FIXME("(%p)->(%lu): stub\n", This, cookie);
875 return E_NOTIMPL;
878 static const IActiveIMMMessagePumpOwnerVtbl ActiveIMMMessagePumpOwnerVtbl =
880 ActiveIMMMessagePumpOwner_QueryInterface,
881 ActiveIMMMessagePumpOwner_AddRef,
882 ActiveIMMMessagePumpOwner_Release,
883 ActiveIMMMessagePumpOwner_Start,
884 ActiveIMMMessagePumpOwner_End,
885 ActiveIMMMessagePumpOwner_OnTranslateMessage,
886 ActiveIMMMessagePumpOwner_Pause,
887 ActiveIMMMessagePumpOwner_Resume,
890 HRESULT ActiveIMMApp_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut)
892 ActiveIMMApp *This;
893 if (pUnkOuter)
894 return CLASS_E_NOAGGREGATION;
896 This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ActiveIMMApp));
897 if (This == NULL)
898 return E_OUTOFMEMORY;
900 This->IActiveIMMApp_iface.lpVtbl = &ActiveIMMAppVtbl;
901 This->IActiveIMMMessagePumpOwner_iface.lpVtbl = &ActiveIMMMessagePumpOwnerVtbl;
902 This->refCount = 1;
904 TRACE("returning %p\n",This);
905 *ppOut = (IUnknown *)&This->IActiveIMMApp_iface;
906 return S_OK;