首先声明,这段代码是针对《金山词霸2003》的,金山词霸的其它版本需要稍为修改。
源代码说明:
1:请自己去下载LoadDll,并且研究它的使用(只需要简单修改命令行):
http://www.codeguru.com/Cpp/W-P/dll/article.php/c105/
2: 把其中的TestFunction()替换为4中的源代码
3:注意:
3.1) ////////////////////////////////////////////////////////////////////
// The following code is to read explanationlist
和
///////////////// end of code to read explanation /////////////////
之间的代码是读取单词解释的。
3.2)
////////////////////////////////////////////////////////////////////
// The following code is to read word list
和
///////////////// end of code to read word list /////////////////
是读取单词列表的。
请自己修改
4.源代码
FILE * g_fileCiba=NULL;
void WriteWord(int nIndex,LPCTSTR pszString)
{
static const int STRING_MAX = 1024 * 100;
static TCHAR pszBuffer[STRING_MAX + 1]="";
if (pszString == NULL)
{
// flush the buffer: pszBuffer
if (strlen(pszBuffer) > 0)
fputs(pszBuffer,g_fileCiba);
return;
}
if (strlen(pszString) > STRING_MAX) {
::MessageBox( 0, "Word too long!", _T("TestLib"), MB_OK );
return;
}
if (strlen(pszString) + strlen(pszBuffer) > STRING_MAX)
{
// flush the buffer: pszBuffer
fputs(pszBuffer,g_fileCiba);
// clear the content
memset(pszBuffer,0,sizeof(pszBuffer));
strcpy(pszBuffer,pszString);
}
else {
&

这段代码主要用于读取金山词霸2003的单词列表和解释,通过查找并操作其窗口句柄实现。程序首先找到主窗口,然后定位到单词列表、解释窗口和组合框,通过模拟用户操作读取单词和解释,并写入文件。代码中包含读取单词解释和单词列表的两个部分,但注释掉了读取单词列表的部分。

423

被折叠的 条评论
为什么被折叠?



