http://www.52hxw.com/ 这个网站提供了一个输入法外挂的程序,启动程序后,无论是用什么输入法,输入的文字上屏后都会被自动转换为异体字。这个程序的原理我猜测应该是用了消息HOOK技术,拦截并修改了输入法发送给应用程序的wm_char消息。程序安装后有一个dll文件,这个dll会被注入到系统所有进程,实现HOOK
我知道纯vb无法写出标准dll,可以使用vb+vc的方法实现。我对hook不是很熟,想问一下拦截wm_char消息需要安装哪个hook,vb具体怎么实现(有现成的dll模块更好),还有注入其它进程的dll如何与主程序通信?请高手指点一下,谢谢了
我知道纯vb无法写出标准dll,可以使用vb+vc的方法实现。我对hook不是很熟,想问一下拦截wm_char消息需要安装哪个hook,vb具体怎么实现(有现成的dll模块更好),还有注入其它进程的dll如何与主程序通信?请高手指点一下,谢谢了
解决方案 »
- 关于DATAREPORT1.LABEL1.CAPTION
- 请问vb怎么禁用ie
- VB程序的自己查自己的小问题
- 求教:想调用金山词霸中的*.DIC文件,何解?
- 请求帮忙,VB引用EXCEL,遇到类型匹配问题???
- 如何读取dbgrid的当前行的内容进入各文本框?(很急!!)
- 高手请进...
- ◆◇◆急救◆◇◆如何将屏幕的某块区域(部分在form上,部分在image上......)显示出来的图象复制到form的另一块上,而且可以按比例缩放?
- VB6中为何会有乱码
- 如何学习VB?
- 同一条查询语句,在VB中使用时与在SQL Server的查询分析器里使用时,返回结果不同的问题
- 新装了一台服务器,连了几台客户端,刚开始我把几台客户端的odbc都配通了,可过了一会有两台又不通。我从配这两台,不能马上配通,多试几
不一定的,VB也直接可以用的,简单思路:
下钩
SetWindowsHookEx WH_GETMESSAGE...钩子函数
function...除钩
UnhookWindowsEx...
加载
运行ing
结束
WPARAM wParam,
LPARAM lParam
);
Parameterscode
[in] Specifies whether the hook procedure must process the message. If code is HC_ACTION, the hook procedure must process the message. If code is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx.
wParam
[in] Specifies whether the message has been removed from the queue. This parameter can be one of the following values.
PM_NOREMOVE
Specifies that the message has not been removed from the queue. (An application called the PeekMessage function, specifying the PM_NOREMOVE flag.)
PM_REMOVE
Specifies that the message has been removed from the queue. (An application called GetMessage, or it called the PeekMessage function, specifying the PM_REMOVE flag.)
lParam
[in] Pointer to an MSG structure that contains details about the message.
Return ValueIf code is less than zero, the hook procedure must return the value returned by CallNextHookEx. If code is greater than or equal to zero, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_GETMESSAGE hooks will not receive hook notifications and may behave incorrectly as a result. If the hook procedure does not call CallNextHookEx, the return value should be zero.
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
PCWPSTRUCT pcw=(PCWPSTRUCT) lParam;
if(nCode>=0 && pcw && pcw->hwnd)
{
if(pcw->message==WM_CHAR)
{
..............
谢谢asa5880 ^_^