编译、调试输入法程序的方法

来源:互联网 发布:python 微信上传图片 编辑:程序博客网 时间:2024/04/29 20:59

1、确保应用 Imm32.lib

       Project->Settings->Link->General 在 Object/library modules中添加 imm32.lib

 

2、如果 IMM.H 和 INDICML.H 的位置在项目中,应在 additional include directories 中指定。

       Project->Settings->C/C++->Preprocessor 在 Additional include directories 中设置 ./

 

3、在模块定义文件(.def)中包含(EXPORTS)下列 IME 函数

                ImeConversionList
                ImeConfigure
                ImeDestroy
                ImeEscape
                ImeInquire
                ImeProcessKey
                ImeSelect
                ImeSetActiveContext
                ImeToAsciiEx
                NotifyIME
                ImeRegisterWord
                ImeUnregisterWord
                ImeGetRegisterWordStyle
                ImeEnumRegisterWord
                ImeSetCompositionString
                ;ImeGetImeMenuItems

                UIWndProc
                CompWndProc
                CandWndProc
                StatusWndProc

 

4、指定用于调试的外部程序

       Project->Settings->Debug,在 Executable for debug session 中设置用于调试的应用程序路径及名称。例如c:/windows/notepad.exe

 

5、将输出定位到SYSTEM32。

       Project->Settings->Debug,在 Output file name 中设置输出名称 c:/windows/system32/*.ime(*.ime用具体的名称代替)。

 

6、添加注册表项

   在 HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Control/Keyboard Layouts 下新建项(如E00F0804,804:简体中文;411:日文),分别创建三个字符串值项: IME file, Layout File, Layout Text。

   IME file:输入法应用程序名称(如 wubi.ime)

   Layout File:键盘布局(如 KBDUS.DLL)

   Layout Text:在输入法列表中显示的名称

 

7、从控制面板中添加你的输入法到输入法列表中。

 

8、在VS中设置断点,按下F5,在输入法列表中选择你的输入法。

原创粉丝点击