Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Oct : Re: System Hook for Window Events
| Subject: | Re: System Hook for Window Events |
| Posted by: | "Peter Below (TeamB)" (none) |
| Date: | 13 Oct 2006 11:11:13 |
Mikas wrote:
> Can anyone please let me know how do I do a system hook for window
> events such as WM_CLOSE, using SetWindowsHookEx?? In the first
> parameter of this function I'm using WH_JOURNALRECORD, but I don't
> know why, this only gives me mouse and keyboard messages...
That's exactly what it is supposed to give you. This hook type is
intended to be used to record user input. The only hook types that
would be able to trap a send message like WM_CLOSE would be
WH_CALLWNDPROC and its cousing WH_CALLWNDPROCRET, but those are not
hooks you want to use globally, they get a *lot* of messages and are a
drain on the system performance. Investigate WH_SHELL or WH_CBT hooks
if you want to get notified on window creation and destruction.
I'm just happy that all this hook nonsense will basically go away with
Vista....
--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be