Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Oct : Trapping messages

www.cryer.info
Managed Newsgroup Archive

Trapping messages

Subject:Trapping messages
Posted by:"Peter" (peter.l..@accenttechnology.co.uk)
Date:Wed, 24 Oct 2007 11:12:23

Hi

I am trying to trap messages passed to a delphi (BDS2006) app using:

function TForm1.AppHookFunc(var Message : TMessage) : Boolean;
begin
   Result := True;
end;

I am also using Application.HookMainWindow(AppHookFunc) in the form
create and Application.UnhookMainWindow(AppHookFunc) in the form
destroy.  By setting result to true I would have expected the form to no
longer recieve any messages but it seems to get all of them.  The
message queue is hooked as I have put a memo on the form and used
apphookfunc() to write message details to it.

What am I doing wrong?


Peter

Replies:

www.cryer.info
Managed Newsgroup Archive