有什么API函数可以操纵输入法? (200分)

  • 主题发起人 主题发起人 ynfly
  • 开始时间 开始时间
Y

ynfly

Unregistered / Unconfirmed
GUEST, unregistred user!
情况是这样的,在一个OA系统中进入到Word编辑界面时,发现输入法居然跟原来在OA系统中<br>的输入法不同了原来可能是“五笔”输入法的,进入到Word编辑界面后就发现输入法变成了<br>英文或其它的输入法,十分麻烦,我想在进入到Word编辑界面前记录下当前的输入法状态,<br>然后在进入到Word编辑状态后恢复原来的输入法(注意:在进入到Word后由宏来调用相应的<br>API函数),有什么函数可以控制输入法的更改呢?
 
所有的函数都在这里了。<br>EnumInputContext<br>EnumRegisterWordProc<br>ImmAssociateContext<br>ImmAssociateContextEx<br>ImmConfigureIME<br>ImmCreateContext<br>ImmDestroyContext<br>ImmDisableIME<br>ImmEnumInputContext<br>ImmEnumRegisterWord<br>ImmEscape<br>ImmGetCandidateList<br>ImmGetCandidateListCount<br>ImmGetCandidateWindow<br>ImmGetCompositionFont<br>ImmGetCompositionString<br>ImmGetCompositionWindow<br>ImmGetContext<br>ImmGetConversionList<br>ImmGetConversionStatus<br>ImmGetDefaultIMEWnd<br>ImmGetDescription<br>ImmGetGuideLine<br>ImmGetIMEFileName<br>ImmGetImeMenuItems<br>ImmGetOpenStatus<br>ImmGetProperty<br>ImmGetRegisterWordStyle<br>ImmGetStatusWindowPos<br>ImmGetVirtualKey<br>ImmInstallIME<br>ImmIsIME<br>ImmIsUIMessage<br>ImmNotifyIME<br>ImmRegisterWord<br>ImmReleaseContext<br>ImmSetCandidateWindow<br>ImmSetCompositionFont<br>ImmSetCompositionString<br>ImmSetCompositionWindow<br>ImmSetConversionStatus<br>ImmSetOpenStatus Opens<br>ImmSetStatusWindowPos<br>ImmSimulateHotKey<br>ImmUnregisterWord <br>vc不用定义,bcb须#include &lt;imm.hpp&gt;<br>delphi须use imm
 
真是编程到家了,本来可以很简单的切换:Ctrl + 空格(中英文)<br>或者Ctrl + Shift全部切换<br><br>你的问题值得研究研究………<br>关注:
 
<br>//将所有输入法激活一遍<br>For i:=0 to Screen.Imes.Count do<br>&nbsp;activatekeyboardlayout(HKL_NEXT,KLF_ACTIVATE);
 
ImmGetCompositionWindow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //取编码窗口信息<br><br>ImmSetCompositionWindow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//设置编码窗口信息 <br><br>ImmGetCandidateWindow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//取选择窗口信息 <br><br>ImmSetCandidateWindow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//设置选择窗口信息<br><br>ImmGetCompositionString &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //取编码窗口的某一信息<br><br>ImmSetCompositionString &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置编码窗口的某一信息<br><br>ImmGetCompositionFont &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //取编码字体<br><br>ImmSetCompositionFont &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置编码字体<br><br>ImmGetNumCandidateList &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //取选择区中编码数<br><br>ImmGetCandidateList &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//取选择区中编码<br><br>ImmGetGuideLine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br><br>ImmGetConversionStatus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//取当前输入法的状态(ACSII,SHAPE,FULL等)<br><br>ImmGetConversionList &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//重新获得选择区转换表<br><br>ImmGetOpenStatus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //取输入法打开属性<br><br>ImmSetConversionStatus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//设置输入法状态<br><br>ImmSetOpenStatus &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置输入法打开状态<br><br>ImmNotifyIME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //通报IME,输入法状态被改变<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmGenerateMessage &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//将我们的汉字串法发送到与当前输入法相关联的应用软件中<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmRequestMessage &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//向应用程序发送WM_IME_REQUEST<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmLockIMC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//获取当前IMC的INPUTCONTEXT结构信息,增加IMC 计数器<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmUnlockIMC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//释放IMC计数器<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmGetIMCLockCount &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//取计数器值<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmCreateIMCC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//创建INPUTCONTEXT结构的一个成员<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmDestroyIMCC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //删除IMC成员缓冲区<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmLockIMCC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//取IMCC缓冲地址,同时使IMCC的计数器值增加<br>&nbsp; &nbsp; &nbsp; &nbsp; ImmUnlockIMCC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //递减IMCC计数器<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ImmReSizeIMCC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //重新设置IMC的成员的缓冲区大小<br>&nbsp; &nbsp; &nbsp; &nbsp; ImmGetIMCCSize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//取IMC成员的缓冲区大小<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImmGetIMCCLockCount &nbsp; &nbsp; &nbsp; //返回IMC计数器值<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImmGetHotKey &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //取输入法状态键,该函数供控制面板使用<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImmSetHotKey &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置输入法的热键<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImmCreateSoftKeyboard &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//产生一个软键盘<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImmDestroySoftKeyboard &nbsp; &nbsp; &nbsp;//销毁软键盘<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImmShowSoftKeyboard &nbsp; &nbsp; &nbsp;//显示或隐藏软键盘<br>----------<br>楼主贴出来太乱了<br>如要给我个Email:yczjs@163.com
 
好了,谢谢
 
后退
顶部