横秋兄以及对操纵输入法的词库熟悉的朋友请进来, 被折磨了几个晚上, 没有一点头绪, 请进来指教!

linuxyf 2005-12-29 08:28:59
加精
想对Microsoft (Simplified)- pinyin IME 3.0输入法的词库进行操纵----增加词组,删除词组,备份,不知道如何去做,请大家给点思路,先谢过!

我查到几个用来实现功能的API,但没有例子,不会用啊,

分别是:ImmGetRegisterWordStyle
ImmRegisterWord
ImmUnregisterWord

有谁用过???
...全文
165 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
linuxyf 2005-12-31
  • 打赏
  • 举报
回复
终于实现了,谢谢
jiangshengMKII 2005-12-30
  • 打赏
  • 举报
回复
和其他回调一样用,写一个
UINT CALLBACK 函数名(
LPCTSTR lpszReading,
DWORD dwStyle,
LPCTSTR lpszString,
LPVOID lpData
);

这样的函数,然后把函数地址作为参数。
蒋晟 2005-12-30
  • 打赏
  • 举报
回复
用LoadLibrary加载IME文件(那实际上是DLL),之后调用ImmRegisterWord函数。
在我的计算机上的微软拼音输入法 2003(v6.0.0.2527)的文件名是IMSC40A.IME。
linuxyf 2005-12-30
  • 打赏
  • 举报
回复
jiangsheng(蒋晟.Net) 兄,如何调用ImmEnumRegisterWord这个方法??

方法定义如下:
Enumerates the register strings having the specified reading string, style, and register string.

UINT ImmEnumRegisterWord(
HKL hKL,
REGISTERWORDENUMPROC lpfnEnumProc,
LPCTSTR lpszReading,
DWORD dwStyle,
LPCTSTR lpszRegister,
LPVOID lpData
);

Parameters

hKL
[in] Input locale identifier.
lpfnEnumProc
[in] Pointer to the callback function. For more information, see EnumRegisterWordProc.
lpszReading
[in] Pointer to the reading string to be enumerated. If NULL, this function enumerates all available reading strings that match the specified dwStyle and lpszRegister.
dwStyle
[in] Specifies the style to enumerate. If zero, this function enumerates all available styles that match the specified lpszReading and lpszRegister.
lpszRegister
[in] Pointer to the register string to enumerate. If NULL, this function enumerates all register strings that match the specified lpszReading and dwStyle.
lpData
[in] Pointer to the application-supplied data. The function passes this parameter to the callback function.

Return Values

Returns the last value returned by the callback function. Its meaning is defined by the application. The function returns zero if it cannot enumerate the register strings.
Remarks

If dwStyle is zero and both lpszReading and lpszRegister are NULL, the ImmEnumRegisterWord function enumerates all register strings in the IME dictionary.\

第二个参数十个回调函数,我不会使用,请你指点一下。谢谢

EnumRegisterWordProc

An application-defined callback function used with the ImmEnumRegisterWord function. It is used to process data of register strings. The REGISTERWORDENUMPROC type defines a pointer to this callback function. EnumRegisterWordProc is a placeholder for the application-defined function name.

UINT CALLBACK EnumRegisterWordProc(
LPCTSTR lpszReading,
DWORD dwStyle,
LPCTSTR lpszString,
LPVOID lpData
);

Parameters

lpszReading
[in] Pointer to a null-terminated string specifying the matched reading string.
dwStyle
[in] Specifies the style of register string.
lpszString
[in] Pointer to a null-terminated string specifying the matched register string.
lpData
[in] Application-supplied data.

Return Values

Returns a nonzero value to continue enumeration or zero to stop enumeration.
Remarks

An application must register this function by passing its address to the ImmEnumRegisterWord function.
huangjianmin 2005-12-29
  • 打赏
  • 举报
回复
做记号的.
wuchi 2005-12-29
  • 打赏
  • 举报
回复
这个词库是不是用access数据库做的?如果是,找到它的数据库文件,直接对这文件操作吧
布学无数 2005-12-29
  • 打赏
  • 举报
回复
那个输入法的词库根本就不是由那几个API进行操作的。
而是自定义的结构,如果你真想要得到数据的话,分析一下文件就可以了,并不是很辛苦。
HelloIvan2005 2005-12-29
  • 打赏
  • 举报
回复
up

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧