指出:该hook过程同系统中的所有线程关联。
以下是c写的例程,大家可以方便的转换为vb程序。
hookproc hkprcsysmsg;
static hinstance hinstdll;
static hhook hhooksysmsg;
.
.
.
hinstdll = loadlibrary((lpctstr) "c:\\windows\\sysmsg.dll");
hkprcsysmsg = (hookproc)getprocaddress(hinstdll, "sysmessageproc");
hhooksysmsg = setwindowshookex(wh_sysmsgfilter,
hkprcsysmsg, hinstdll, 0);