>I tried using GetMethodProp(Self,
>'ParentWindowProc') instead of MethodAddress but it resulted in access
>violations - don't know why.

Sussed this bit.  I was cheating (sort of) by having the procedure
ParentWindowProc in the published section, which GetMethodProp doesn't like,
rather than having a published property which gets assigned to the procedure
in the FormCreate.  Doing it the other way lets me have the HookProc call as
a single statement:

    HookProc(Self, AParent, @TMethod(AParent.WindowProc),
GetMethodProp(Self, 'ParentWindowProc'));

where ParentWindowProc is now a TWndMethod assigned to
"InternalParentWindowProc" in the object's constructor.  Still not perfect
but a bit better.  ParentWindowProc still has to be published but at least
now it can be read only.

Cheers,
Carl
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to