W
wuym1972
Unregistered / Unconfirmed
GUEST, unregistred user!
我用delphi实现一个服务程序的钩子函数, TXXX = class(TService) procedure ServiceStop(Sender: TService; var Stopped: Boolean); procedure ServiceStart(Sender: TService; var Started: Boolean); private { Private declarations } public function GetServiceController: TServiceController; override; { Public declarations } end;procedure TIPMS.ServiceStart(Sender: TService; var Started: Boolean);begin......LogHook := SetWindowsHookEx(WH_JOURNALRECORD, LogProc, HInstance, 0);......end;就这句:LogHook := SetWindowsHookEx(WH_JOURNALRECORD, LogProc, HInstance, 0);在服务程序中钩子函数始终不起作用,但是如果放在form中就起作用。[red]钩子函数相关模块肯定没有问题,只是如果放在服务程序中就不行,为什么?[/red]非常感谢您的解答!