imm.c
资源名称:大熊猫输入法原码.zip [点击查看]
上传用户:szljw888
上传日期:2010-04-11
资源大小:124k
文件大小:18k
源码类别:
输入法编程
开发平台:
C/C++
- /* 大熊猫输入法(Free Chinese Input) 由YJMSIR(yjmsir@163.com)编写
- * 协议: GPL
- * freeinput( A Chinese Input Method) by YJMSIR(yjmsir@163.com)
- * Licence: GPL
- */
- #include "freepy.h"
- BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo,LPTSTR lpszUIClass,LPCTSTR lpszOption)
- {
- //DebugLog(1,(DebugLogFile,"ImeInquiren"));
- lpIMEInfo->dwPrivateDataSize = sizeof(UIEXTRA);
- lpIMEInfo->fdwProperty = IME_PROP_KBD_CHAR_FIRST |
- #ifdef _UNICODE
- IME_PROP_UNICODE |
- #endif
- IME_PROP_SPECIAL_UI;
- lpIMEInfo->fdwConversionCaps = IME_CMODE_FULLSHAPE |
- IME_CMODE_NATIVE;
- lpIMEInfo->fdwSentenceCaps = IME_SMODE_NONE;
- lpIMEInfo->fdwUICaps = UI_CAP_2700;
- lpIMEInfo->fdwSCSCaps = 0;
- lpIMEInfo->fdwSelectCaps = SELECT_CAP_CONVERSION;
- _tcscpy(lpszUIClass,UICLASSNAME);
- return TRUE;
- }
- BOOL WINAPI ImeConfigure(HKL hKL,HWND hWnd, DWORD dwMode, LPVOID lpData)
- {
- //DebugLog(1,(DebugLogFile,"ImeConfiguren"));
- DialogBox( hInst,MAKEINTRESOURCE(DIALOGSET),hWnd,SetDialogProc);
- InvalidateRect(hWnd,NULL,FALSE);
- return TRUE;
- }
- DWORD WINAPI ImeConversionList(HIMC hIMC,LPCTSTR lpSource,LPCANDIDATELIST lpCandList,DWORD dwBufLen,UINT uFlag)
- {
- //DebugLog(1,(DebugLogFile,"ImeConversionListn"));
- return 0;
- }
- BOOL WINAPI ImeDestroy(UINT uForce)
- {
- //DebugLog(1,(DebugLogFile,"ImeDestroyn"));
- return FALSE;
- }
- LRESULT WINAPI ImeEscape(HIMC hIMC,UINT uSubFunc,LPVOID lpData)
- {
- //DebugLog(1,(DebugLogFile,"ImeEscapen"));
- return FALSE;
- }
- BOOL WINAPI ImeProcessKey(HIMC hIMC,UINT vKey,LPARAM lKeyData,CONST LPBYTE lpbKeyState)
- {
- BOOL fRet = FALSE;
- BOOL fOpen;
- BOOL fCompStr = FALSE;
- LPINPUTCONTEXT lpIMC;
- LPCANDIDATEINFO lpCandInfo;
- LPCANDIDATELIST lpCandList;
- LPCOMPOSITIONSTRING lpCompStr;
- static BOOL fPressOther = FALSE;
- static BOOL fFirst = TRUE;
- // //DebugLog(1,(DebugLogFile,"ImeProcessKeyn"));
- /*if ((lKeyData & 0x80000000) && vKey != VK_CONTROL)
- return FALSE;
- if (!(lKeyData & 0x80000000) && vKey == VK_CONTROL)
- return FALSE;
- if (lpbKeyState[VK_MENU] & 0x80 ) {
- return FALSE;
- }*/
- //随着ALT键的按次,lpbKeyState[VK_MENU]在0与1间变换
- //DebugLog(2,(DebugLogFile,"vKey:%x, lpbKeyState[VK_CONTROL]:%xn",vKey,lpbKeyState[VK_CONTROL]));
- if (!(lpIMC = ImmLockIMC(hIMC)))
- return FALSE;
- //ctrl+`切换成五笔
- if(vKey == 0xc0 && lpbKeyState[VK_CONTROL] & 0x80 ){
- TurnIntoWubiMode(hIMC);
- HotKeyPressed=1;
- return 1;
- // return FALSE;
- }
- //ctrl+tab切换成拼音
- if(vKey == 0x9 && lpbKeyState[VK_CONTROL] & 0x80 ){
- TurnIntoPinyinMode(hIMC);
- HotKeyPressed=1;
- return 1;//FALSE;
- }
- //ctrl+切换五笔与拼音
- if(vKey == 0xdc && lpbKeyState[VK_CONTROL] & 0x80 ){
- static i=0; i++;if(i<2) return FALSE;i=0;
- ToggleConversionMode(hIMC);
- HotKeyPressed=1;
- return 1;
- // return 0;
- }
- //ctrl+m gbk模式
- if(vKey == 0x4d && lpbKeyState[VK_CONTROL] & 0x80 ){
- //static i=0; i++;if(i<2) return FALSE;i=0;
- if( wConversionSet & CONVERSION_SET_GBK)
- MessageBoxPrintf(_T("切换gbk"),_T("到gb2312"));
- else MessageBoxPrintf(_T("切换gb2312"),_T("到gbk"));
- ToggleConversionSet(CONVERSION_SET_GBK);
- UpdateStatusByMessage(hIMC);
- HotKeyPressed=1;
- return 1;
- }
- //_T('j')//ctrl+shift+j 日本字功能
- if(vKey == 0x48 && lpbKeyState[VK_SHIFT] & 0x80 && lpbKeyState[VK_CONTROL] & 0x80 ){
- ToggleConversionSet(CONVERSION_SET_JP);
- HotKeyPressed=1;
- return 1;
- // return FALSE;
- }
- //ctrl+j输简得繁功能
- if(vKey == 0x48 && lpbKeyState[VK_CONTROL] & 0x80 ){
- ToggleConversionSet(CONVERSION_SET_GBJT2FT);
- HotKeyPressed=1;
- return 1;
- // return FALSE;
- }
- //_T('')//ctrl+shift+ 大五码功能
- if(vKey == 0xdc && lpbKeyState[VK_SHIFT] & 0x80 && lpbKeyState[VK_CONTROL] & 0x80 ){
- ToggleConversionSet(CONVERSION_SET_BIG5);
- HotKeyPressed=1;
- return 1;
- // return FALSE;
- }
- //_T('.')中西文标点切换
- if(vKey == 0xbe && lpbKeyState[VK_CONTROL] & 0x80 ){
- static i=0; i++;if(i<2) return FALSE;i=0;
- ToggleConversionSet(CONVERSION_SET_PUNCT);
- UpdateStatusByMessage(hIMC);
- HotKeyPressed=1;
- return 1;
- // return FALSE;
- }
- //shift+space全角半角字符切换
- if(vKey == 0x20 && lpbKeyState[VK_SHIFT] & 0x80 ){
- static i=0; i++;if(i<2) return FALSE;i=0;
- ToggleConversionSet(CONVERSION_SET_FULLSHAPE);
- UpdateStatusByMessage(hIMC);
- HotKeyPressed=1;
- return 1;
- // return FALSE;
- }
- //ctrl+/取得五笔编码
- if(vKey == 0xbf && lpbKeyState[VK_CONTROL] & 0x80 &&
- wConversionSet &CONVERSION_SET_USEWB){
- ReturnWuBicode(hIMC);
- HotKeyPressed=1;
- return 1;
- }
- //以上是各种状态通用快捷键
- //以下为五笔状态专用快捷键
- if(wConversionMode == CONVERSION_MODE_WUBI){
- if((vKey == 0xba|| vKey == 0x44)&& lpbKeyState[VK_CONTROL] & 0x80 ){//ctrl+;或者d剪贴板造词
- MakeWordFromClipboard(hIMC);
- HotKeyPressed=1;
- return 1;
- }
- if(vKey == 0xbb && lpbKeyState[VK_CONTROL] & 0x80 ){//ctrl++在线造词
- TurnIntoWubiModeAdd(hIMC);
- HotKeyPressed=1;
- return 1;
- //return FALSE;
- }
- if(vKey == 0xbd && lpbKeyState[VK_CONTROL] & 0x80 ){//ctrl+-在线删词
- LPTSTR lpPreResultStr;
- lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr);
- lpPreResultStr = ((LPMYCOMPSTR)lpCompStr)->FreePYComp.szPreResultStr;
- MessageBoxPrintf(_T("删除词库内的词组"),_T("编码:%sn词组:%s"),
- szPreResultCode, lpPreResultStr);
- DeleteWbPhrase (szPreResultCode, lpPreResultStr);
- HotKeyPressed=1;
- return 1;
- }
- if(vKey == 0x49 && lpbKeyState[VK_CONTROL] & 0x80 ){//ctrl+i用户词库加入系统词库
- TurnUserWordIntoSys();
- HotKeyPressed=1;
- return 1;
- }
- if(vKey >=0x30 && vKey <=0x39 && lpbKeyState[VK_SHIFT] & 0x80 &&
- lpbKeyState[VK_CONTROL] & 0x80 ){//ctrl+shift+0-9在线删词键
- DWORD dwIdx;
- LPTSTR lpConvStr;
- lpCandInfo = (LPCANDIDATEINFO)ImmLockIMCC(lpIMC->hCandInfo);
- lpCandList = (LPCANDIDATELIST)((LPSTR)lpCandInfo + lpCandInfo->dwOffset[0]);
- lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr);
- if( vKey == (WORD)_T('0'))
- dwIdx=9;
- else
- dwIdx = vKey - _T('1');
- if(dwIdx < lpCandList->dwPageSize ) {
- dwIdx += lpCandList->dwPageStart;
- if( dwIdx < (lpCandList->dwCount + 2) && lpCandList->dwCount){
- lpConvStr = ((LPMYCOMPSTR)lpCompStr)->FreePYComp.szConvCompStr;
- _tcscpy(lpConvStr,GETLPCANDSTR(lpCandList,dwIdx));
- DeleteWbPhrase (szPreResultCode, lpConvStr);
- MakeResultString(hIMC,FALSE);
- }
- }
- HotKeyPressed=1;
- return 1;
- // return FALSE;
- }
- //ctrl+0-9//在线高频键
- if(vKey >=0x30 && vKey <=0x39 && lpbKeyState[VK_CONTROL] & 0x80 ){
- WORD wIdx;
- lpCandInfo = (LPCANDIDATEINFO)ImmLockIMCC(lpIMC->hCandInfo);
- lpCandList = (LPCANDIDATELIST)((LPSTR)lpCandInfo + lpCandInfo->dwOffset[0]);
- if(vKey==0x30) wIdx=9;
- else wIdx=vKey-0x31;
- wIdx=wIdx+(WORD)lpCandList->dwPageStart-2;
- AdjustOrderByIndexToNo1(wIdx,GETLPCANDSTR(lpCandList,wIdx));
- MakeResultString(hIMC,FALSE);//清空
- ImmUnlockIMCC(lpIMC->hCandInfo);
- HotKeyPressed=1;
- return 1;
- // return FALSE;
- }
- //ctrl+'切换词库
- if(vKey == 0xde && lpbKeyState[VK_CONTROL] & 0x80 ){
- TurnToNextWordLib(0);
- UpdateIcontheme();
- //UpdateStatusByMessage(hIMC);
- CreateStatusByMessage(hIMC);
- HotKeyPressed=1;
- return 1;
- }
- /*
- //ctrl+tab切换成拼音
- if(vKey == 0x9 && lpbKeyState[VK_CONTROL] & 0x80 ){
- TurnIntoPinyinMode(hIMC);
- HotKeyPressed=1;
- return 1;//FALSE;
- }
- if(vKey == 0x9 && lpbKeyState[VK_SHIFT] & 0x80 ){//shift+tab向前翻页
- lpCandInfo = (LPCANDIDATEINFO)ImmLockIMCC(lpIMC->hCandInfo);
- lpCandList = (LPCANDIDATELIST)((LPSTR)lpCandInfo + lpCandInfo->dwOffset[0]);
- SelectBackwardFromCand(hIMC,lpCandList);
- ImmUnlockIMCC(lpIMC->hCandInfo);
- return FALSE;//
- }
- if(vKey == 0x9){//tab向后翻页
- lpCandInfo = (LPCANDIDATEINFO)ImmLockIMCC(lpIMC->hCandInfo);
- lpCandList = (LPCANDIDATELIST)((LPSTR)lpCandInfo + lpCandInfo->dwOffset[0]);
- SelectForwardFromCand(hIMC,lpCandList);
- ImmUnlockIMCC(lpIMC->hCandInfo);
- return FALSE;
- } */
- }
- /* if (vKey != VK_SHIFT &&lpbKeyState[VK_SHIFT] & 0x80){
- char ayjm[50],cyjm[150];
- _stprintf(ayjm,"vKey:%x lpbKeyState[VK_CAPITAL]:%x lKeyData:%x ",vKey,lpbKeyState[VK_CAPITAL],lKeyData);
- _stprintf(cyjm,"lpbKeyState[VK_CONTROL]:%xn lpbKeyState[VK_MENU]:%xn lpbKeyState[VK_SHIFT]:%xn",
- lpbKeyState[VK_CONTROL],lpbKeyState[VK_MENU],lpbKeyState[VK_SHIFT]);
- MessageBox(NULL,cyjm,ayjm,MB_OK);
- return FALSE;
- }*///10,360001,
- if(vKey != VK_CONTROL && lpbKeyState[VK_CONTROL] & 0x80 ) {
- fPressOther = TRUE;
- return FALSE;
- }
- //随着CONTROL键的按次,lpbKeyState[CONTROL]在80与81间变换
- //if (!(lpIMC = ImmLockIMC(hIMC)))
- // return FALSE;
- fOpen = lpIMC->fOpen;
- //if(vKey == VK_CONTROL && (lKeyData & 0x80000000) && !fPressOther && !fFirst){
- if(vKey == 0x10 && (lpbKeyState[VK_SHIFT] & 0x80) && (lKeyData==0x360001)){
- GENEMSG GnMsg;//右shift中英文切换
- fPressOther = FALSE;
- if(fOpen) {
- lpIMC->fOpen=FALSE;
- MakeResultString(hIMC,FALSE);
- }
- else lpIMC->fOpen=TRUE;
- GnMsg.msg = WM_IME_NOTIFY;
- GnMsg.wParam = IMN_SETOPENSTATUS;
- GnMsg.lParam = 0;
- GenerateMessage(hIMC, lpdwCurTransKey,(LPGENEMSG)&GnMsg);
- return FALSE;
- }
- fPressOther = FALSE;
- if(fFirst) fFirst = FALSE;
- /*
- //if CapsLock is pressed ,then return false;
- if (lpbKeyState[VK_CAPITAL] & 0x01) {
- wPreConversionMode =wConversionMode;
- wConversionMode =CONVERSION_MODE_CAPITAL;
- return FALSE;
- }
- //随着VK_CAPITAL键的按次,lpbKeyState[VK_CAPITAL]在80与81间变换
- if (fOpen)
- {
- if (lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr))
- {
- if ((lpCompStr->dwSize > sizeof(COMPOSITIONSTRING)) &&
- (lpCompStr->dwCompStrLen))
- fCompStr = TRUE;
- ImmUnlockIMCC(lpIMC->hCompStr);
- }
- if (dwConversionMode & CONVERSION_MODE_FULLSHAPE){
- if (lpbKeyState[VK_SHIFT] & 0x80)
- {
- if (fCompStr)
- fRet = (BOOL)bFullCompSht[vKey];
- else
- fRet = (BOOL)bFullNoCompSht[vKey];
- }
- else
- {
- if (fCompStr)
- fRet = (BOOL)bFullComp[vKey];
- else
- fRet = (BOOL)bFullNoComp[vKey];
- }
- }
- else{
- if (lpbKeyState[VK_SHIFT] & 0x80)
- {
- if (fCompStr)
- fRet = (BOOL)bCompSht[vKey];
- else
- fRet = (BOOL)bNoCompSht[vKey];
- }
- else
- {
- if (fCompStr)
- fRet = (BOOL)bComp[vKey];
- else
- fRet = (BOOL)bNoComp[vKey];
- }
- }
- }
- */
- if (fOpen)
- {
- if (lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr))
- {
- if ((lpCompStr->dwSize > sizeof(COMPOSITIONSTRING)) &&
- (lpCompStr->dwCompStrLen))
- fCompStr = TRUE;
- ImmUnlockIMCC(lpIMC->hCompStr);
- }
- if (fCompStr)
- fRet = (BOOL)bComp[vKey];
- else
- fRet = (BOOL)bNoComp[vKey];
- }
- ImmUnlockIMC(hIMC);
- /* if(1){
- char ayjm[50];
- _stprintf(ayjm,"vKey:%x,fRet:%d",vKey,fRet);
- MessageBox(NULL,ayjm,"",MB_OK);
- }*/
- return fRet;
- //ImmUnlockIMC(hIMC);
- //return 1;
- }
- BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect)
- {
- LPINPUTCONTEXT lpIMC;
- if (fSelect)
- UpdateIndicIcon(hIMC);
- // it's NULL context.
- if (!hIMC)
- return TRUE;
- if (lpIMC = ImmLockIMC(hIMC))
- {
- if (fSelect)
- {
- LPCOMPOSITIONSTRING lpCompStr;
- LPCANDIDATEINFO lpCandInfo;
- DWORD dwData = sizeof(DWORD);
- BOOL fFlag = TRUE;
- lpIMC->fOpen=TRUE;
- lpIMC->hCompStr = ImmReSizeIMCC(lpIMC->hCompStr,sizeof(MYCOMPSTR));
- if (lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr))
- {
- InitCompStr(lpCompStr);
- ImmUnlockIMCC(lpIMC->hCompStr);
- }
- lpIMC->hCandInfo = ImmReSizeIMCC(lpIMC->hCandInfo,sizeof(MYCAND));
- if (lpCandInfo = (LPCANDIDATEINFO)ImmLockIMCC(lpIMC->hCandInfo))
- {
- InitCandInfo(lpCandInfo);
- ImmUnlockIMCC(lpIMC->hCandInfo);
- }
- ReadUserIni();
- fFlag = FALSE;
- if( fFlag) {//如果读取注册表失败,则选择
- wConversionSet |= CONVERSION_SET_PUNCT;//中文标点
- wConversionSet |= CONVERSION_SET_SORT;//自动调整
- wConversionSet |= CONVERSION_SET_FOLLOW;//光标跟随
- wConversionSet |= CONVERSION_SET_GBK;//gbk码
- wConversionMode=CONVERSION_MODE_PINYIN;//拼音
- }
- }
- }
- ImmUnlockIMC(hIMC);
- return TRUE;
- }
- BOOL WINAPI ImeSetActiveContext(HIMC hIMC,BOOL fFlag)
- {
- //DebugLog(1,(DebugLogFile,"ImeSetActiveContextn"));
- UpdateIndicIcon(hIMC);
- return TRUE;
- }
- UINT WINAPI ImeToAsciiEx (UINT uVKey,UINT uScanCode,CONST LPBYTE lpbKeyState,
- LPDWORD lpdwTransKey,UINT fuState,HIMC hIMC)
- {
- LPARAM lParam;
- LPINPUTCONTEXT lpIMC;
- BOOL fOpen;
- //LPINPUTCONTEXT lpIMC;
- //LPCANDIDATEINFO lpCandInfo;
- //LPCANDIDATELIST lpCandList;
- if (!(lpIMC = ImmLockIMC(hIMC)))
- return FALSE;
- // //DebugLog(1,(DebugLogFile,"ImeToAsciiExn"));
- /*/ if (wParam != VK_SHIFT &&lpbKeyState[VK_SHIFT] & 0x80){
- if(1){
- char ayjm[50],cyjm[150];
- _stprintf(ayjm,"vKey1:%x lpbKeyState[VK_CAPITAL]:%x lKeyData:%x ",uVKey,lpbKeyState[VK_CAPITAL],uScanCode);
- _stprintf(cyjm,"lpbKeyState[VK_CONTROL]:%xn lpbKeyState[VK_MENU]:%xn lpbKeyState[VK_SHIFT]:%xn",
- lpbKeyState[VK_CONTROL],lpbKeyState[VK_MENU],lpbKeyState[VK_SHIFT]);
- MessageBox(NULL,cyjm,ayjm,MB_OK);
- return FALSE;
- }*///10,360001,
- /* if(uVKey == 0x9 && lpbKeyState[VK_SHIFT] & 0x80 ){//shift+tab向前翻页
- lpCandInfo = (LPCANDIDATEINFO)ImmLockIMCC(lpIMC->hCandInfo);
- lpCandList = (LPCANDIDATELIST)((LPSTR)lpCandInfo + lpCandInfo->dwOffset[0]);
- SelectBackwardFromCand(hIMC,lpCandList);
- ImmUnlockIMCC(lpIMC->hCandInfo);
- return FALSE;//
- }
- if(uVKey == 0x9){//tab向后翻页
- lpCandInfo = (LPCANDIDATEINFO)ImmLockIMCC(lpIMC->hCandInfo);
- lpCandList = (LPCANDIDATELIST)((LPSTR)lpCandInfo + lpCandInfo->dwOffset[0]);
- SelectForwardFromCand(hIMC,lpCandList);
- ImmUnlockIMCC(lpIMC->hCandInfo);
- //YJMStopInput=1;
- return FALSE;
- }*/
- lpdwCurTransKey = lpdwTransKey;
- lParam = ((DWORD)uScanCode << 16) + 1L;
- // Init uNumTransKey here.
- uNumTransKey = 0;
- // if hIMC is NULL, this means DISABLE IME.
- if (!hIMC)
- return 0;
- if (!(lpIMC = ImmLockIMC(hIMC)))
- return 0;
- fOpen = lpIMC->fOpen;
- ImmUnlockIMC(hIMC);
- // The current status of IME is "closed".
- if (!fOpen)
- goto my_exit;
- if (uScanCode & 0x8000)
- IMEKeyupHandler( hIMC, uVKey, lParam, lpbKeyState);
- else
- IMEKeydownHandler( hIMC, uVKey, lParam, lpbKeyState);
- // Clear static value, no more generated message!
- lpdwCurTransKey = NULL;
- my_exit:
- // If trans key buffer that is allocated by USER.EXE full up,
- // the return value is the negative number.
- if (fOverTransKey)
- {
- return (int)uNumTransKey;
- }
- return (int)uNumTransKey;
- }
- BOOL WINAPI NotifyIME(HIMC hIMC,DWORD dwAction,DWORD dwIndex,DWORD dwValue)
- {
- BOOL bRet = FALSE;
- LPINPUTCONTEXT lpIMC;
- //DebugLog(1,(DebugLogFile,"NotifyIMEn"));
- switch(dwAction)
- {
- case NI_OPENCANDIDATE:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_OPENCANDIDATEn"));
- break;
- case NI_CLOSECANDIDATE:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CLOSECANDIDATEn"));
- break;
- case NI_SELECTCANDIDATESTR:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_SELECTCANDIDATESTRn"));
- break;
- case NI_CHANGECANDIDATELIST:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CHANGECANDIDATELISTn"));
- break;
- case NI_SETCANDIDATE_PAGESTART:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_SETCANDIDATE_PAGESTARTn"));
- break;
- case NI_SETCANDIDATE_PAGESIZE:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_SETCANDIDATE_PAGESIZEn"));
- break;
- case NI_CONTEXTUPDATED:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CONTEXTUPDATEDn"));
- switch (dwValue)
- {
- case IMC_SETCONVERSIONMODE:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CONTEXTUPDATED:IMC_SETCONVERSIONMODEn"));
- break;
- case IMC_SETSENTENCEMODE:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CONTEXTUPDATED:IMC_SETSENTENCEMODEn"));
- break;
- case IMC_SETCANDIDATEPOS:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CONTEXTUPDATED:IMC_SETCANDIDATEPOSn"));
- break;
- case IMC_SETCOMPOSITIONFONT:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CONTEXTUPDATED:IMC_SETCOMPOSITIONFONTn"));
- break;
- case IMC_SETCOMPOSITIONWINDOW:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CONTEXTUPDATED:IMC_SETCOMPOSITIONWINDOWn"));
- break;
- case IMC_SETOPENSTATUS:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_CONTEXTUPDATED:IMC_SETOPENSTATUSn"));
- lpIMC = ImmLockIMC(hIMC);
- if (lpIMC)
- {
- if (!lpIMC->fOpen && IsCompStr(hIMC))
- MakeResultString( hIMC,FALSE);
- ImmUnlockIMC(hIMC);
- }
- UpdateIndicIcon(hIMC);
- bRet = TRUE;
- break;
- default:
- break;
- }
- break;
- case NI_COMPOSITIONSTR:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_COMPOSITIONSTRn"));
- switch (dwIndex)
- {
- case CPS_COMPLETE:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_COMPOSITIONSTR:CPS_COMPLETEn"));
- break;
- case CPS_CONVERT:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_COMPOSITIONSTR:CPS_CONVERTn"));
- break;
- case CPS_REVERT:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_COMPOSITIONSTR:CPS_REVERTn"));
- break;
- case CPS_CANCEL:
- //DebugLog(1,(DebugLogFile,"NotifyIME:NI_COMPOSITIONSTR:CPS_CANCELn"));
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- return bRet;
- }
- BOOL WINAPI ImeRegisterWord(LPCTSTR lpRead, DWORD dw, LPCTSTR lpStr)
- {
- //DebugLog(1,(DebugLogFile,"ImeRegisterWordn"));
- return FALSE;
- }
- BOOL WINAPI ImeUnregisterWord(LPCTSTR lpRead, DWORD dw, LPCTSTR lpStr)
- {
- //DebugLog(1,(DebugLogFile,"ImeUnregisterWordn"));
- return FALSE;
- }
- UINT WINAPI ImeGetRegisterWordStyle(UINT nItem, LPSTYLEBUF lp)
- {
- //DebugLog(1,(DebugLogFile,"ImeGetRegisterWordStylen"));
- return 0;
- }
- UINT WINAPI ImeEnumRegisterWord(REGISTERWORDENUMPROC lpfn, LPCTSTR lpRead, DWORD dw, LPCTSTR lpStr, LPVOID lpData)
- {
- //DebugLog(1,(DebugLogFile,"ImeEnumRegisterWordn"));
- return 0;
- }
- BOOL WINAPI ImeSetCompositionString(HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD dwComp, LPCVOID lpRead, DWORD dwRead)
- {
- //DebugLog(1,(DebugLogFile,"ImeSetCompositionStringn"));
- return FALSE;
- }