Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
HZspecial.c
Package: freedompinyin.zip [view]
Upload User: yangna0709
Upload Date: 2020-09-07
Package Size: 567k
Code Size: 3k
Category:
IME Develop
Development Platform:
Visual C++
- /*
- * 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 RepeatPreResult(HIMC hIMC)
- {
- LPINPUTCONTEXT lpIMC;
- LPCOMPOSITIONSTRING lpCompStr;
- GENEMSG GnMsg;
- LPTSTR lpPreResultStr;
- wConversionMode = 0;
- lpIMC = ImmLockIMC(hIMC);
- lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr);
- lpPreResultStr = ((LPMYCOMPSTR)lpCompStr)->FreePYComp.szPreResultStr;
- if( _tcslen(lpPreResultStr) ){
- _tcscpy(GETLPRESULTSTR(lpCompStr),lpPreResultStr);
- lpCompStr->dwResultStrLen = _tcslen(lpPreResultStr);
- lpCompStr->dwCompStrLen = 0;
- GnMsg.msg = WM_IME_COMPOSITION;
- GnMsg.wParam = 0;
- GnMsg.lParam = GCS_RESULTSTR;
- GenerateMessage(hIMC, lpdwCurTransKey,(LPGENEMSG)&GnMsg);
- GnMsg.msg = WM_IME_ENDCOMPOSITION;
- GnMsg.wParam = 0;
- GnMsg.lParam = 0;
- GenerateMessage(hIMC, lpdwCurTransKey,(LPGENEMSG)&GnMsg);
- ImmUnlockIMCC(lpIMC->hCompStr);
- ImmUnlockIMC(hIMC);
- return TRUE;
- }
- ImmUnlockIMCC(lpIMC->hCompStr);
- ImmUnlockIMC(hIMC);
- return FALSE;
- }
- BOOL GeneratePunct(HIMC hIMC, WORD wCode)
- {
- LPINPUTCONTEXT lpIMC;
- LPCOMPOSITIONSTRING lpCompStr;
- LPTSTR lpStr,lpConvStr,lpPreResultStr;
- WORD wHead;
- TCHAR cLastPreResultChar;
- lpIMC = ImmLockIMC(hIMC);
- lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr);
- lpCompStr->dwCompStrLen = 0;
- lpConvStr = ((LPMYCOMPSTR)lpCompStr)->FreePYComp.szConvCompStr;
- if(wConversionSet & CONVERSION_SET_PUNCT) {
- wHead = wCode - _T('!');
- lpStr = aPunct[wHead][0];
- if( _tcslen(lpStr) ){
- if( wCode == _T('.') || wCode == _T('/') ) {
- lpPreResultStr = ((LPMYCOMPSTR)lpCompStr)->FreePYComp.szPreResultStr;
- cLastPreResultChar = *CharPrev(lpPreResultStr,lpPreResultStr + _tcslen(lpPreResultStr));
- if(cLastPreResultChar >= _T('!') && cLastPreResultChar <= _T('~') ) {
- *lpConvStr = (TCHAR)wCode;
- *(lpConvStr+1) = _T('');
- }
- else _tcscpy(lpConvStr,lpStr);
- }
- else _tcscpy(lpConvStr,lpStr);
- MakeResultString(hIMC,TRUE);
- ImmUnlockIMCC(lpIMC->hCompStr);
- ImmUnlockIMC(hIMC);
- return TRUE;
- }
- }
- else {
- *lpConvStr = (TCHAR)wCode;
- *(lpConvStr+1) = _T('');
- MakeResultString(hIMC,TRUE);
- ImmUnlockIMCC(lpIMC->hCompStr);
- ImmUnlockIMC(hIMC);
- return TRUE;
- }
- ImmUnlockIMCC(lpIMC->hCompStr);
- ImmUnlockIMC(hIMC);
- return FALSE;
- }