Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenactiveimmapp.c
Go to the documentation of this file.
00001 /* 00002 * ActiveIMMApp Interface 00003 * 00004 * Copyright 2008 CodeWeavers, Aric Stewart 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00019 */ 00020 00021 #include "config.h" 00022 00023 #include <stdarg.h> 00024 00025 #define COBJMACROS 00026 00027 #include "windef.h" 00028 #include "winbase.h" 00029 #include "wingdi.h" 00030 #include "winreg.h" 00031 #include "winuser.h" 00032 #include "winerror.h" 00033 #include "objbase.h" 00034 #include "dimm.h" 00035 #include "imm.h" 00036 00037 #include "wine/unicode.h" 00038 00039 #include "wine/debug.h" 00040 00041 WINE_DEFAULT_DEBUG_CHANNEL(msimtf); 00042 00043 typedef struct tagActiveIMMApp { 00044 IActiveIMMApp IActiveIMMApp_iface; 00045 LONG refCount; 00046 } ActiveIMMApp; 00047 00048 static inline ActiveIMMApp *impl_from_IActiveIMMApp(IActiveIMMApp *iface) 00049 { 00050 return CONTAINING_RECORD(iface, ActiveIMMApp, IActiveIMMApp_iface); 00051 } 00052 00053 static void ActiveIMMApp_Destructor(ActiveIMMApp* This) 00054 { 00055 TRACE("\n"); 00056 HeapFree(GetProcessHeap(),0,This); 00057 } 00058 00059 static HRESULT WINAPI ActiveIMMApp_QueryInterface (IActiveIMMApp* iface, 00060 REFIID iid, LPVOID *ppvOut) 00061 { 00062 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface); 00063 *ppvOut = NULL; 00064 00065 if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_IActiveIMMApp)) 00066 { 00067 *ppvOut = This; 00068 } 00069 00070 if (*ppvOut) 00071 { 00072 IUnknown_AddRef(iface); 00073 return S_OK; 00074 } 00075 00076 WARN("unsupported interface: %s\n", debugstr_guid(iid)); 00077 return E_NOINTERFACE; 00078 } 00079 00080 static ULONG WINAPI ActiveIMMApp_AddRef(IActiveIMMApp* iface) 00081 { 00082 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface); 00083 return InterlockedIncrement(&This->refCount); 00084 } 00085 00086 static ULONG WINAPI ActiveIMMApp_Release(IActiveIMMApp* iface) 00087 { 00088 ActiveIMMApp *This = impl_from_IActiveIMMApp(iface); 00089 ULONG ret; 00090 00091 ret = InterlockedDecrement(&This->refCount); 00092 if (ret == 0) 00093 ActiveIMMApp_Destructor(This); 00094 return ret; 00095 } 00096 00097 static HRESULT WINAPI ActiveIMMApp_AssociateContext(IActiveIMMApp* iface, 00098 HWND hWnd, HIMC hIME, HIMC *phPrev) 00099 { 00100 *phPrev = ImmAssociateContext(hWnd,hIME); 00101 return S_OK; 00102 } 00103 00104 static HRESULT WINAPI ActiveIMMApp_ConfigureIMEA(IActiveIMMApp* This, 00105 HKL hKL, HWND hwnd, DWORD dwMode, REGISTERWORDA *pData) 00106 { 00107 BOOL rc; 00108 00109 rc = ImmConfigureIMEA(hKL, hwnd, dwMode, pData); 00110 if (rc) 00111 return E_FAIL; 00112 else 00113 return S_OK; 00114 } 00115 00116 static HRESULT WINAPI ActiveIMMApp_ConfigureIMEW(IActiveIMMApp* This, 00117 HKL hKL, HWND hWnd, DWORD dwMode, REGISTERWORDW *pData) 00118 { 00119 BOOL rc; 00120 00121 rc = ImmConfigureIMEW(hKL, hWnd, dwMode, pData); 00122 if (rc) 00123 return E_FAIL; 00124 else 00125 return S_OK; 00126 } 00127 00128 static HRESULT WINAPI ActiveIMMApp_CreateContext(IActiveIMMApp* This, 00129 HIMC *phIMC) 00130 { 00131 *phIMC = ImmCreateContext(); 00132 if (*phIMC) 00133 return S_OK; 00134 else 00135 return E_FAIL; 00136 } 00137 00138 static HRESULT WINAPI ActiveIMMApp_DestroyContext(IActiveIMMApp* This, 00139 HIMC hIME) 00140 { 00141 BOOL rc; 00142 00143 rc = ImmDestroyContext(hIME); 00144 if (rc) 00145 return S_OK; 00146 else 00147 return E_FAIL; 00148 } 00149 00150 static HRESULT WINAPI ActiveIMMApp_EnumRegisterWordA(IActiveIMMApp* This, 00151 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szRegister, 00152 LPVOID pData, IEnumRegisterWordA **pEnum) 00153 { 00154 FIXME("Stub\n"); 00155 return E_NOTIMPL; 00156 } 00157 00158 static HRESULT WINAPI ActiveIMMApp_EnumRegisterWordW(IActiveIMMApp* This, 00159 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister, 00160 LPVOID pData, IEnumRegisterWordW **pEnum) 00161 { 00162 FIXME("Stub\n"); 00163 return E_NOTIMPL; 00164 } 00165 00166 static HRESULT WINAPI ActiveIMMApp_EscapeA(IActiveIMMApp* This, 00167 HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT *plResult) 00168 { 00169 *plResult = ImmEscapeA(hKL, hIMC, uEscape, pData); 00170 return S_OK; 00171 } 00172 00173 static HRESULT WINAPI ActiveIMMApp_EscapeW(IActiveIMMApp* This, 00174 HKL hKL, HIMC hIMC, UINT uEscape, LPVOID pData, LRESULT *plResult) 00175 { 00176 *plResult = ImmEscapeW(hKL, hIMC, uEscape, pData); 00177 return S_OK; 00178 } 00179 00180 static HRESULT WINAPI ActiveIMMApp_GetCandidateListA(IActiveIMMApp* This, 00181 HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST *pCandList, 00182 UINT *puCopied) 00183 { 00184 *puCopied = ImmGetCandidateListA(hIMC, dwIndex, pCandList, uBufLen); 00185 return S_OK; 00186 } 00187 00188 static HRESULT WINAPI ActiveIMMApp_GetCandidateListW(IActiveIMMApp* This, 00189 HIMC hIMC, DWORD dwIndex, UINT uBufLen, CANDIDATELIST *pCandList, 00190 UINT *puCopied) 00191 { 00192 *puCopied = ImmGetCandidateListW(hIMC, dwIndex, pCandList, uBufLen); 00193 return S_OK; 00194 } 00195 00196 static HRESULT WINAPI ActiveIMMApp_GetCandidateListCountA(IActiveIMMApp* This, 00197 HIMC hIMC, DWORD *pdwListSize, DWORD *pdwBufLen) 00198 { 00199 *pdwBufLen = ImmGetCandidateListCountA(hIMC, pdwListSize); 00200 return S_OK; 00201 } 00202 00203 static HRESULT WINAPI ActiveIMMApp_GetCandidateListCountW(IActiveIMMApp* This, 00204 HIMC hIMC, DWORD *pdwListSize, DWORD *pdwBufLen) 00205 { 00206 *pdwBufLen = ImmGetCandidateListCountA(hIMC, pdwListSize); 00207 return S_OK; 00208 } 00209 00210 static HRESULT WINAPI ActiveIMMApp_GetCandidateWindow(IActiveIMMApp* This, 00211 HIMC hIMC, DWORD dwIndex, CANDIDATEFORM *pCandidate) 00212 { 00213 BOOL rc; 00214 rc = ImmGetCandidateWindow(hIMC,dwIndex,pCandidate); 00215 if (rc) 00216 return S_OK; 00217 else 00218 return E_FAIL; 00219 } 00220 00221 static HRESULT WINAPI ActiveIMMApp_GetCompositionFontA(IActiveIMMApp* This, 00222 HIMC hIMC, LOGFONTA *plf) 00223 { 00224 BOOL rc; 00225 rc = ImmGetCompositionFontA(hIMC,plf); 00226 if (rc) 00227 return S_OK; 00228 else 00229 return E_FAIL; 00230 } 00231 00232 static HRESULT WINAPI ActiveIMMApp_GetCompositionFontW(IActiveIMMApp* This, 00233 HIMC hIMC, LOGFONTW *plf) 00234 { 00235 BOOL rc; 00236 rc = ImmGetCompositionFontW(hIMC,plf); 00237 if (rc) 00238 return S_OK; 00239 else 00240 return E_FAIL; 00241 } 00242 00243 static HRESULT WINAPI ActiveIMMApp_GetCompositionStringA(IActiveIMMApp* This, 00244 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG *plCopied, LPVOID pBuf) 00245 { 00246 *plCopied = ImmGetCompositionStringA(hIMC, dwIndex, pBuf, dwBufLen); 00247 return S_OK; 00248 } 00249 00250 static HRESULT WINAPI ActiveIMMApp_GetCompositionStringW(IActiveIMMApp* This, 00251 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LONG *plCopied, LPVOID pBuf) 00252 { 00253 *plCopied = ImmGetCompositionStringW(hIMC, dwIndex, pBuf, dwBufLen); 00254 return S_OK; 00255 } 00256 00257 static HRESULT WINAPI ActiveIMMApp_GetCompositionWindow(IActiveIMMApp* This, 00258 HIMC hIMC, COMPOSITIONFORM *pCompForm) 00259 { 00260 BOOL rc; 00261 00262 rc = ImmGetCompositionWindow(hIMC,pCompForm); 00263 00264 if (rc) 00265 return S_OK; 00266 else 00267 return E_FAIL; 00268 } 00269 00270 static HRESULT WINAPI ActiveIMMApp_GetContext(IActiveIMMApp* This, 00271 HWND hwnd, HIMC *phIMC) 00272 { 00273 *phIMC = ImmGetContext(hwnd); 00274 return S_OK; 00275 } 00276 00277 static HRESULT WINAPI ActiveIMMApp_GetConversionListA(IActiveIMMApp* This, 00278 HKL hKL, HIMC hIMC, LPSTR pSrc, UINT uBufLen, UINT uFlag, 00279 CANDIDATELIST *pDst, UINT *puCopied) 00280 { 00281 *puCopied = ImmGetConversionListA(hKL, hIMC, pSrc, pDst, uBufLen, uFlag); 00282 return S_OK; 00283 } 00284 00285 static HRESULT WINAPI ActiveIMMApp_GetConversionListW(IActiveIMMApp* This, 00286 HKL hKL, HIMC hIMC, LPWSTR pSrc, UINT uBufLen, UINT uFlag, 00287 CANDIDATELIST *pDst, UINT *puCopied) 00288 { 00289 *puCopied = ImmGetConversionListW(hKL, hIMC, pSrc, pDst, uBufLen, uFlag); 00290 return S_OK; 00291 } 00292 00293 static HRESULT WINAPI ActiveIMMApp_GetConversionStatus(IActiveIMMApp* This, 00294 HIMC hIMC, DWORD *pfdwConversion, DWORD *pfdwSentence) 00295 { 00296 BOOL rc; 00297 00298 rc = ImmGetConversionStatus(hIMC, pfdwConversion, pfdwSentence); 00299 00300 if (rc) 00301 return S_OK; 00302 else 00303 return E_FAIL; 00304 } 00305 00306 static HRESULT WINAPI ActiveIMMApp_GetDefaultIMEWnd(IActiveIMMApp* This, 00307 HWND hWnd, HWND *phDefWnd) 00308 { 00309 *phDefWnd = ImmGetDefaultIMEWnd(hWnd); 00310 return S_OK; 00311 } 00312 00313 static HRESULT WINAPI ActiveIMMApp_GetDescriptionA(IActiveIMMApp* This, 00314 HKL hKL, UINT uBufLen, LPSTR szDescription, UINT *puCopied) 00315 { 00316 *puCopied = ImmGetDescriptionA(hKL, szDescription, uBufLen); 00317 return S_OK; 00318 } 00319 00320 static HRESULT WINAPI ActiveIMMApp_GetDescriptionW(IActiveIMMApp* This, 00321 HKL hKL, UINT uBufLen, LPWSTR szDescription, UINT *puCopied) 00322 { 00323 *puCopied = ImmGetDescriptionW(hKL, szDescription, uBufLen); 00324 return S_OK; 00325 } 00326 00327 static HRESULT WINAPI ActiveIMMApp_GetGuideLineA(IActiveIMMApp* This, 00328 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPSTR pBuf, 00329 DWORD *pdwResult) 00330 { 00331 *pdwResult = ImmGetGuideLineA(hIMC, dwIndex, pBuf, dwBufLen); 00332 return S_OK; 00333 } 00334 00335 static HRESULT WINAPI ActiveIMMApp_GetGuideLineW(IActiveIMMApp* This, 00336 HIMC hIMC, DWORD dwIndex, DWORD dwBufLen, LPWSTR pBuf, 00337 DWORD *pdwResult) 00338 { 00339 *pdwResult = ImmGetGuideLineW(hIMC, dwIndex, pBuf, dwBufLen); 00340 return S_OK; 00341 } 00342 00343 static HRESULT WINAPI ActiveIMMApp_GetIMEFileNameA(IActiveIMMApp* This, 00344 HKL hKL, UINT uBufLen, LPSTR szFileName, UINT *puCopied) 00345 { 00346 *puCopied = ImmGetIMEFileNameA(hKL, szFileName, uBufLen); 00347 return S_OK; 00348 } 00349 00350 static HRESULT WINAPI ActiveIMMApp_GetIMEFileNameW(IActiveIMMApp* This, 00351 HKL hKL, UINT uBufLen, LPWSTR szFileName, UINT *puCopied) 00352 { 00353 *puCopied = ImmGetIMEFileNameW(hKL, szFileName, uBufLen); 00354 return S_OK; 00355 } 00356 00357 static HRESULT WINAPI ActiveIMMApp_GetOpenStatus(IActiveIMMApp* This, 00358 HIMC hIMC) 00359 { 00360 return ImmGetOpenStatus(hIMC); 00361 } 00362 00363 static HRESULT WINAPI ActiveIMMApp_GetProperty(IActiveIMMApp* This, 00364 HKL hKL, DWORD fdwIndex, DWORD *pdwProperty) 00365 { 00366 *pdwProperty = ImmGetProperty(hKL, fdwIndex); 00367 return S_OK; 00368 } 00369 00370 static HRESULT WINAPI ActiveIMMApp_GetRegisterWordStyleA(IActiveIMMApp* This, 00371 HKL hKL, UINT nItem, STYLEBUFA *pStyleBuf, UINT *puCopied) 00372 { 00373 *puCopied = ImmGetRegisterWordStyleA(hKL, nItem, pStyleBuf); 00374 return S_OK; 00375 } 00376 00377 static HRESULT WINAPI ActiveIMMApp_GetRegisterWordStyleW(IActiveIMMApp* This, 00378 HKL hKL, UINT nItem, STYLEBUFW *pStyleBuf, UINT *puCopied) 00379 { 00380 *puCopied = ImmGetRegisterWordStyleW(hKL, nItem, pStyleBuf); 00381 return S_OK; 00382 } 00383 00384 static HRESULT WINAPI ActiveIMMApp_GetStatusWindowPos(IActiveIMMApp* This, 00385 HIMC hIMC, POINT *pptPos) 00386 { 00387 BOOL rc; 00388 rc = ImmGetStatusWindowPos(hIMC, pptPos); 00389 00390 if (rc) 00391 return S_OK; 00392 else 00393 return E_FAIL; 00394 } 00395 00396 static HRESULT WINAPI ActiveIMMApp_GetVirtualKey(IActiveIMMApp* This, 00397 HWND hWnd, UINT *puVirtualKey) 00398 { 00399 *puVirtualKey = ImmGetVirtualKey(hWnd); 00400 return S_OK; 00401 } 00402 00403 static HRESULT WINAPI ActiveIMMApp_InstallIMEA(IActiveIMMApp* This, 00404 LPSTR szIMEFileName, LPSTR szLayoutText, HKL *phKL) 00405 { 00406 *phKL = ImmInstallIMEA(szIMEFileName,szLayoutText); 00407 return S_OK; 00408 } 00409 00410 static HRESULT WINAPI ActiveIMMApp_InstallIMEW(IActiveIMMApp* This, 00411 LPWSTR szIMEFileName, LPWSTR szLayoutText, HKL *phKL) 00412 { 00413 *phKL = ImmInstallIMEW(szIMEFileName,szLayoutText); 00414 return S_OK; 00415 } 00416 00417 static HRESULT WINAPI ActiveIMMApp_IsIME(IActiveIMMApp* This, 00418 HKL hKL) 00419 { 00420 return ImmIsIME(hKL); 00421 } 00422 00423 static HRESULT WINAPI ActiveIMMApp_IsUIMessageA(IActiveIMMApp* This, 00424 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam) 00425 { 00426 return ImmIsUIMessageA(hWndIME,msg,wParam,lParam); 00427 } 00428 00429 static HRESULT WINAPI ActiveIMMApp_IsUIMessageW(IActiveIMMApp* This, 00430 HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam) 00431 { 00432 return ImmIsUIMessageW(hWndIME,msg,wParam,lParam); 00433 } 00434 00435 static HRESULT WINAPI ActiveIMMApp_NotifyIME(IActiveIMMApp* This, 00436 HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue) 00437 { 00438 BOOL rc; 00439 00440 rc = ImmNotifyIME(hIMC,dwAction,dwIndex,dwValue); 00441 00442 if (rc) 00443 return S_OK; 00444 else 00445 return E_FAIL; 00446 } 00447 00448 static HRESULT WINAPI ActiveIMMApp_RegisterWordA(IActiveIMMApp* This, 00449 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szRegister) 00450 { 00451 BOOL rc; 00452 00453 rc = ImmRegisterWordA(hKL,szReading,dwStyle,szRegister); 00454 00455 if (rc) 00456 return S_OK; 00457 else 00458 return E_FAIL; 00459 } 00460 00461 static HRESULT WINAPI ActiveIMMApp_RegisterWordW(IActiveIMMApp* This, 00462 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szRegister) 00463 { 00464 BOOL rc; 00465 00466 rc = ImmRegisterWordW(hKL,szReading,dwStyle,szRegister); 00467 00468 if (rc) 00469 return S_OK; 00470 else 00471 return E_FAIL; 00472 } 00473 00474 static HRESULT WINAPI ActiveIMMApp_ReleaseContext(IActiveIMMApp* This, 00475 HWND hWnd, HIMC hIMC) 00476 { 00477 BOOL rc; 00478 00479 rc = ImmReleaseContext(hWnd,hIMC); 00480 00481 if (rc) 00482 return S_OK; 00483 else 00484 return E_FAIL; 00485 } 00486 00487 static HRESULT WINAPI ActiveIMMApp_SetCandidateWindow(IActiveIMMApp* This, 00488 HIMC hIMC, CANDIDATEFORM *pCandidate) 00489 { 00490 BOOL rc; 00491 00492 rc = ImmSetCandidateWindow(hIMC,pCandidate); 00493 00494 if (rc) 00495 return S_OK; 00496 else 00497 return E_FAIL; 00498 } 00499 00500 static HRESULT WINAPI ActiveIMMApp_SetCompositionFontA(IActiveIMMApp* This, 00501 HIMC hIMC, LOGFONTA *plf) 00502 { 00503 BOOL rc; 00504 00505 rc = ImmSetCompositionFontA(hIMC,plf); 00506 00507 if (rc) 00508 return S_OK; 00509 else 00510 return E_FAIL; 00511 } 00512 00513 static HRESULT WINAPI ActiveIMMApp_SetCompositionFontW(IActiveIMMApp* This, 00514 HIMC hIMC, LOGFONTW *plf) 00515 { 00516 BOOL rc; 00517 00518 rc = ImmSetCompositionFontW(hIMC,plf); 00519 00520 if (rc) 00521 return S_OK; 00522 else 00523 return E_FAIL; 00524 } 00525 00526 static HRESULT WINAPI ActiveIMMApp_SetCompositionStringA(IActiveIMMApp* This, 00527 HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen, 00528 LPVOID pRead, DWORD dwReadLen) 00529 { 00530 BOOL rc; 00531 00532 rc = ImmSetCompositionStringA(hIMC,dwIndex,pComp,dwCompLen,pRead,dwReadLen); 00533 00534 if (rc) 00535 return S_OK; 00536 else 00537 return E_FAIL; 00538 } 00539 00540 static HRESULT WINAPI ActiveIMMApp_SetCompositionStringW(IActiveIMMApp* This, 00541 HIMC hIMC, DWORD dwIndex, LPVOID pComp, DWORD dwCompLen, 00542 LPVOID pRead, DWORD dwReadLen) 00543 { 00544 BOOL rc; 00545 00546 rc = ImmSetCompositionStringW(hIMC,dwIndex,pComp,dwCompLen,pRead,dwReadLen); 00547 00548 if (rc) 00549 return S_OK; 00550 else 00551 return E_FAIL; 00552 } 00553 00554 static HRESULT WINAPI ActiveIMMApp_SetCompositionWindow(IActiveIMMApp* This, 00555 HIMC hIMC, COMPOSITIONFORM *pCompForm) 00556 { 00557 BOOL rc; 00558 00559 rc = ImmSetCompositionWindow(hIMC,pCompForm); 00560 00561 if (rc) 00562 return S_OK; 00563 else 00564 return E_FAIL; 00565 } 00566 00567 static HRESULT WINAPI ActiveIMMApp_SetConversionStatus(IActiveIMMApp* This, 00568 HIMC hIMC, DWORD fdwConversion, DWORD fdwSentence) 00569 { 00570 BOOL rc; 00571 00572 rc = ImmSetConversionStatus(hIMC,fdwConversion,fdwSentence); 00573 00574 if (rc) 00575 return S_OK; 00576 else 00577 return E_FAIL; 00578 } 00579 00580 static HRESULT WINAPI ActiveIMMApp_SetOpenStatus(IActiveIMMApp* This, 00581 HIMC hIMC, BOOL fOpen) 00582 { 00583 BOOL rc; 00584 00585 rc = ImmSetOpenStatus(hIMC,fOpen); 00586 00587 if (rc) 00588 return S_OK; 00589 else 00590 return E_FAIL; 00591 } 00592 00593 static HRESULT WINAPI ActiveIMMApp_SetStatusWindowPos(IActiveIMMApp* This, 00594 HIMC hIMC, POINT *pptPos) 00595 { 00596 BOOL rc; 00597 00598 rc = ImmSetStatusWindowPos(hIMC,pptPos); 00599 00600 if (rc) 00601 return S_OK; 00602 else 00603 return E_FAIL; 00604 } 00605 00606 static HRESULT WINAPI ActiveIMMApp_SimulateHotKey(IActiveIMMApp* This, 00607 HWND hwnd, DWORD dwHotKeyID) 00608 { 00609 BOOL rc; 00610 00611 rc = ImmSimulateHotKey(hwnd,dwHotKeyID); 00612 00613 if (rc) 00614 return S_OK; 00615 else 00616 return E_FAIL; 00617 } 00618 00619 static HRESULT WINAPI ActiveIMMApp_UnregisterWordA(IActiveIMMApp* This, 00620 HKL hKL, LPSTR szReading, DWORD dwStyle, LPSTR szUnregister) 00621 { 00622 BOOL rc; 00623 00624 rc = ImmUnregisterWordA(hKL,szReading,dwStyle,szUnregister); 00625 00626 if (rc) 00627 return S_OK; 00628 else 00629 return E_FAIL; 00630 00631 } 00632 00633 static HRESULT WINAPI ActiveIMMApp_UnregisterWordW(IActiveIMMApp* This, 00634 HKL hKL, LPWSTR szReading, DWORD dwStyle, LPWSTR szUnregister) 00635 { 00636 BOOL rc; 00637 00638 rc = ImmUnregisterWordW(hKL,szReading,dwStyle,szUnregister); 00639 00640 if (rc) 00641 return S_OK; 00642 else 00643 return E_FAIL; 00644 } 00645 00646 static HRESULT WINAPI ActiveIMMApp_Activate(IActiveIMMApp* This, 00647 BOOL fRestoreLayout) 00648 { 00649 FIXME("Stub\n"); 00650 return S_OK; 00651 } 00652 00653 static HRESULT WINAPI ActiveIMMApp_Deactivate(IActiveIMMApp* This) 00654 { 00655 FIXME("Stub\n"); 00656 return S_OK; 00657 } 00658 00659 static HRESULT WINAPI ActiveIMMApp_OnDefWindowProc(IActiveIMMApp* This, 00660 HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) 00661 { 00662 //FIXME("Stub (%p %x %lx %lx)\n",hWnd,Msg,wParam,lParam); 00663 return E_FAIL; 00664 } 00665 00666 static HRESULT WINAPI ActiveIMMApp_FilterClientWindows(IActiveIMMApp* This, 00667 ATOM *aaClassList, UINT uSize) 00668 { 00669 FIXME("Stub\n"); 00670 return S_OK; 00671 } 00672 00673 static HRESULT WINAPI ActiveIMMApp_GetCodePageA(IActiveIMMApp* This, 00674 HKL hKL, UINT *uCodePage) 00675 { 00676 FIXME("Stub\n"); 00677 return E_NOTIMPL; 00678 } 00679 00680 static HRESULT WINAPI ActiveIMMApp_GetLangId(IActiveIMMApp* This, 00681 HKL hKL, LANGID *plid) 00682 { 00683 FIXME("Stub\n"); 00684 return E_NOTIMPL; 00685 } 00686 00687 static HRESULT WINAPI ActiveIMMApp_AssociateContextEx(IActiveIMMApp* This, 00688 HWND hWnd, HIMC hIMC, DWORD dwFlags) 00689 { 00690 BOOL rc; 00691 00692 rc = ImmAssociateContextEx(hWnd,hIMC,dwFlags); 00693 00694 if (rc) 00695 return S_OK; 00696 else 00697 return E_FAIL; 00698 } 00699 00700 static HRESULT WINAPI ActiveIMMApp_DisableIME(IActiveIMMApp* This, 00701 DWORD idThread) 00702 { 00703 BOOL rc; 00704 00705 rc = ImmDisableIME(idThread); 00706 00707 if (rc) 00708 return S_OK; 00709 else 00710 return E_FAIL; 00711 } 00712 00713 static HRESULT WINAPI ActiveIMMApp_GetImeMenuItemsA(IActiveIMMApp* This, 00714 HIMC hIMC, DWORD dwFlags, DWORD dwType, 00715 IMEMENUITEMINFOA *pImeParentMenu, IMEMENUITEMINFOA *pImeMenu, 00716 DWORD dwSize, DWORD *pdwResult) 00717 { 00718 *pdwResult = ImmGetImeMenuItemsA(hIMC,dwFlags,dwType,pImeParentMenu,pImeMenu,dwSize); 00719 return S_OK; 00720 } 00721 00722 static HRESULT WINAPI ActiveIMMApp_GetImeMenuItemsW(IActiveIMMApp* This, 00723 HIMC hIMC, DWORD dwFlags, DWORD dwType, 00724 IMEMENUITEMINFOW *pImeParentMenu, IMEMENUITEMINFOW *pImeMenu, 00725 DWORD dwSize, DWORD *pdwResult) 00726 { 00727 *pdwResult = ImmGetImeMenuItemsW(hIMC,dwFlags,dwType,pImeParentMenu,pImeMenu,dwSize); 00728 return S_OK; 00729 } 00730 00731 static HRESULT WINAPI ActiveIMMApp_EnumInputContext(IActiveIMMApp* This, 00732 DWORD idThread, IEnumInputContext **ppEnum) 00733 { 00734 FIXME("Stub\n"); 00735 return E_NOTIMPL; 00736 } 00737 00738 static const IActiveIMMAppVtbl ActiveIMMAppVtbl = 00739 { 00740 ActiveIMMApp_QueryInterface, 00741 ActiveIMMApp_AddRef, 00742 ActiveIMMApp_Release, 00743 00744 ActiveIMMApp_AssociateContext, 00745 ActiveIMMApp_ConfigureIMEA, 00746 ActiveIMMApp_ConfigureIMEW, 00747 ActiveIMMApp_CreateContext, 00748 ActiveIMMApp_DestroyContext, 00749 ActiveIMMApp_EnumRegisterWordA, 00750 ActiveIMMApp_EnumRegisterWordW, 00751 ActiveIMMApp_EscapeA, 00752 ActiveIMMApp_EscapeW, 00753 ActiveIMMApp_GetCandidateListA, 00754 ActiveIMMApp_GetCandidateListW, 00755 ActiveIMMApp_GetCandidateListCountA, 00756 ActiveIMMApp_GetCandidateListCountW, 00757 ActiveIMMApp_GetCandidateWindow, 00758 ActiveIMMApp_GetCompositionFontA, 00759 ActiveIMMApp_GetCompositionFontW, 00760 ActiveIMMApp_GetCompositionStringA, 00761 ActiveIMMApp_GetCompositionStringW, 00762 ActiveIMMApp_GetCompositionWindow, 00763 ActiveIMMApp_GetContext, 00764 ActiveIMMApp_GetConversionListA, 00765 ActiveIMMApp_GetConversionListW, 00766 ActiveIMMApp_GetConversionStatus, 00767 ActiveIMMApp_GetDefaultIMEWnd, 00768 ActiveIMMApp_GetDescriptionA, 00769 ActiveIMMApp_GetDescriptionW, 00770 ActiveIMMApp_GetGuideLineA, 00771 ActiveIMMApp_GetGuideLineW, 00772 ActiveIMMApp_GetIMEFileNameA, 00773 ActiveIMMApp_GetIMEFileNameW, 00774 ActiveIMMApp_GetOpenStatus, 00775 ActiveIMMApp_GetProperty, 00776 ActiveIMMApp_GetRegisterWordStyleA, 00777 ActiveIMMApp_GetRegisterWordStyleW, 00778 ActiveIMMApp_GetStatusWindowPos, 00779 ActiveIMMApp_GetVirtualKey, 00780 ActiveIMMApp_InstallIMEA, 00781 ActiveIMMApp_InstallIMEW, 00782 ActiveIMMApp_IsIME, 00783 ActiveIMMApp_IsUIMessageA, 00784 ActiveIMMApp_IsUIMessageW, 00785 ActiveIMMApp_NotifyIME, 00786 ActiveIMMApp_RegisterWordA, 00787 ActiveIMMApp_RegisterWordW, 00788 ActiveIMMApp_ReleaseContext, 00789 ActiveIMMApp_SetCandidateWindow, 00790 ActiveIMMApp_SetCompositionFontA, 00791 ActiveIMMApp_SetCompositionFontW, 00792 ActiveIMMApp_SetCompositionStringA, 00793 ActiveIMMApp_SetCompositionStringW, 00794 ActiveIMMApp_SetCompositionWindow, 00795 ActiveIMMApp_SetConversionStatus, 00796 ActiveIMMApp_SetOpenStatus, 00797 ActiveIMMApp_SetStatusWindowPos, 00798 ActiveIMMApp_SimulateHotKey, 00799 ActiveIMMApp_UnregisterWordA, 00800 ActiveIMMApp_UnregisterWordW, 00801 00802 ActiveIMMApp_Activate, 00803 ActiveIMMApp_Deactivate, 00804 ActiveIMMApp_OnDefWindowProc, 00805 ActiveIMMApp_FilterClientWindows, 00806 ActiveIMMApp_GetCodePageA, 00807 ActiveIMMApp_GetLangId, 00808 ActiveIMMApp_AssociateContextEx, 00809 ActiveIMMApp_DisableIME, 00810 ActiveIMMApp_GetImeMenuItemsA, 00811 ActiveIMMApp_GetImeMenuItemsW, 00812 ActiveIMMApp_EnumInputContext 00813 }; 00814 00815 DECLSPEC_HIDDEN HRESULT ActiveIMMApp_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) 00816 { 00817 ActiveIMMApp *This; 00818 if (pUnkOuter) 00819 return CLASS_E_NOAGGREGATION; 00820 00821 This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ActiveIMMApp)); 00822 if (This == NULL) 00823 return E_OUTOFMEMORY; 00824 00825 This->IActiveIMMApp_iface.lpVtbl = &ActiveIMMAppVtbl; 00826 This->refCount = 1; 00827 00828 TRACE("returning %p\n",This); 00829 *ppOut = (IUnknown *)This; 00830 return S_OK; 00831 } Generated on Sun May 27 2012 04:25:20 for ReactOS by
1.7.6.1
|