宋体; mso-ascii-font-family: 'times new roman'; mso-hansi-font-family: 'times new roman'; mso-bidi-font-family: 宋体">,如果想停止所有mosue键盘的动作,而放(执行)巨集,那就使用journalplayback hook;hook呢,可以是整个系统为范围(remote hook),即其他 process的动作您也可以拦截,也可以是localhook,它的拦截范围只有process本身。remote hook的hook function要在.dll之中,local hook则在.bas中。
在vb如何设定hook呢?使用setwindowshookex()
declare function setwindowshookex lib "user32" alias "setwindowshookexa"(byval idhook as long, byval lpfn as long, byval hmod as long, byval dwthreadid as long) as long
idhook代表是何种hook,有以下几种
public const wh_callwndproc = 4
public const wh_callwndprocret = 12
public const wh_cbt = 5