VB要做静态DLL基本不可能,即使是一般的钓子写起来也经常有问题,连大师都头痛: 一位大师的话: You don’t need to hear the details of how I wasted time trying to capture keyboard events in a DLL hook procedure or with a message control. Suffice it to say that I pulled out every trick in this book, and none of them worked. I could display the dialog boxes on the screen. I could read text and settings from them. The mouse worked fine. But I couldn’t get the Tab and Enter keys to work.If you want to try this yourself, you’ll probably suffer some of the same frustrations I encountered, and possibly some new ones. Or maybe you’ll find the solution. But before you start down that road, consider the alternatives.
mystring = Space(256) ***加上这句!!!
GetClassName hnw, mystring, Len(mystring)
我提供给你的方法就是:用VC作dll(主要就是把钩子函数放进去),然后再VB中SetWindowsHookEx的时候把那个钩子函数的地址传进去,最后一个参数(好像是dwThreadID)传入0
一位大师的话:
You don’t need to hear the details of how I wasted time trying to capture keyboard events in a DLL hook procedure or with a message control. Suffice it to say that I pulled out every trick in this book, and none of them worked. I could display the dialog boxes on the screen. I could read text and settings from them. The mouse worked fine. But I couldn’t get the Tab and Enter keys to work.If you want to try this yourself, you’ll probably suffer some of the same frustrations I encountered, and possibly some new ones. Or maybe you’ll find the solution. But before you start down that road, consider the alternatives.
wjying(葡萄) :
C 怎么写啊能说个例子吗!
如果你按我说的试试,你会发现你可以坐到你想要的!之所以会出错,是因为你的程序写的有问题!
当然,他们说的也没错,VB做全局钩子很困难,但你要的并用不到全局钩子,就用你上面的代码就可以实现!
没办法,其实“水平”就显示在这!
或者
http://www.vckbase.com/vckbase/vckbase11/vc/nonctrls/system_30/1130008.htm
为什么VB不能做全局DLL
我快受不了VB了!!!!!!!!!!