• pdworz
    了解作者
  • Visual C++
    开发工具
  • 3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2018-08-05 14:38
    上传日期
A test message is sent to the program
wqcg.zip
  • 3R99zXimm.c
    11.3KB
内容介绍
/* * Copyright (C) 1999.4 Li ZhenChun * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License; or * (at your option) any later version. * * This program is distributed in the hope that is will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, M A 02139, USA. * * Author: Li ZhenChun email: zhchli@163.net or zhchli@126.com * */ #include "freepy.h" BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo,LPTSTR lpszUIClass,LPCTSTR lpszOption) { DebugLog(1,(DebugLogFile,"ImeInquire\n")); 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,"ImeConfigure\n")); DialogBox( hInst,MAKEINTRESOURCE(DIALOGCONFIG),hWnd,ConfigDialogProc); InvalidateRect(hWnd,NULL,FALSE); return TRUE; } DWORD WINAPI ImeConversionList(HIMC hIMC,LPCTSTR lpSource,LPCANDIDATELIST lpCandList,DWORD dwBufLen,UINT uFlag) { DebugLog(1,(DebugLogFile,"ImeConversionList\n")); return 0; } BOOL WINAPI ImeDestroy(UINT uForce) { DebugLog(1,(DebugLogFile,"ImeDestroy\n")); return FALSE; } LRESULT WINAPI ImeEscape(HIMC hIMC,UINT uSubFunc,LPVOID lpData) { DebugLog(1,(DebugLogFile,"ImeEscape\n")); return FALSE; } BOOL WINAPI ImeProcessKey(HIMC hIMC,UINT vKey,LPARAM lKeyData,CONST LPBYTE lpbKeyState) { BOOL fRet = FALSE; BOOL fOpen; BOOL fCompStr = FALSE; LPINPUTCONTEXT lpIMC; LPCOMPOSITIONSTRING lpCompStr; static BOOL fPressOther = FALSE; // static BOOL fFirst = TRUE; DebugLog(1,(DebugLogFile,"ImeProcessKey\n")); if ((lKeyData & 0x80000000) && vKey != VK_CONTROL) return FALSE; if (!(lKeyData & 0x80000000) && vKey == VK_CONTROL) return FALSE; if (lpbKeyState[VK_MENU] & 0x80 ) return FALSE; if(vKey != VK_CONTROL && lpbKeyState[VK_CONTROL] & 0x80 ) { fPressOther = TRUE; return FALSE; } if (!(lpIMC = ImmLockIMC(hIMC))) return FALSE; fOpen = lpIMC->fOpen; if(vKey == VK_CONTROL && (lKeyData & 0x80000000) && !fPressOther){ // && !fFirst){ GENEMSG GnMsg; 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) { return FALSE; } 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); return fRet; } BOOL WINAPI ImeSelect(HIMC hIMC, BOOL fSelect) { LPINPUTCONTEXT lpIMC; DebugLog(1,(DebugLogFile,"ImeSelect\n")); if (fSelect) UpdateIndicIcon(hIMC); // it's NULL context. if (!hIMC) return TRUE; if (lpIMC = ImmLockIMC(hIMC)) { if (fSelect) { LPCOMPOSITIONSTRING lpCompStr; LPCANDIDATEINFO lpCandInfo; HKEY hKey; DWORD dwConvSet; DWORD dwData = sizeof(DWORD); BOOL fFlag = TRUE; // Init the general member of IMC. 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); } if ( RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\freepy"), 0, KEY_READ, &hKey) == ERROR_SUCCESS ){ if( RegQueryValueEx( hKey, _T("ConversionSet"), NULL, NULL, (LPBYTE)&dwConvSet, &dwData) == ERROR_SUCCESS ){ wConversionSet = (WORD) dwConvSet; fFlag = FALSE; } RegCloseKey(hKey); } if( fFlag) { wConversionSet = CONVERSION_SET_PUNCT; wConversionSet |= CONVERSION_SET_SORT; wConversionSet |= CONVERSION_SET_FOLLOW; wConversionSet |= CONVERSION_SET_GBK; } } } ImmUnlockIMC(hIMC); return TRUE; } BOOL WINAPI ImeSetActiveContext(HIMC hIMC,BOOL fFlag) { DebugLog(1,(DebugLogFile,"ImeSetActiveContext\n")); 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; DebugLog(1,(DebugLogFile,"ImeToAsciiEx\n")); 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)
评论
    相关推荐
    • btww1.rar
      这是实际项目中的一个串口通信程序 Makefile通过开关, 可使此程序适用于 Linux 和嵌入式 ARM Linux
    • windows进程线程信息查询
      一款类似于procxp的工具,可以查询当前正在运行程序的进程线程等详细信息,有助于调试程序。
    • kmpBoyerMoxre.rar
      用C++实现了kmp,BoyerMoore,和暴力搜索三种算法
    • 77662257.rar
      非常好的静态文字控件,什么样式的都有,旋转的也有
    • kymbol_information_project.rar
      E统天下,织网梦 ,背景不同,Java是基于C++,面向计算机程序 设计
    • Very.rar
      Very nice menu, worthy of reference
    • vvism.rar
      一个可以用语音modem录音放音的Delphi控件源码
    • baikgaound_Change.rar
      Change the background color of the tree control VC source code
    • Blaster-Winloxs.zip
      Blaster is a simple application that illustrates Windows NT,
    • qpopper2.53.tar.Z
      pop3 server