Say I have a Button1.OnClick event linked to Button1Click procedure. I also have Button2.OnClick linked to some other procedure. How do I check that both events are linked t
I do it with this function:
function MethodPointersEqual(const MethodPointer1, MethodPointer2): Boolean;
var
Method1: System.TMethod absolute MethodPointer1;
Method2: System.TMethod absolute MethodPointer2;
begin
Result := (Method1.Code=Method2.Code) and (Method1.Data=Method2.Data)
end;
It works, but if someone knows a less hacky way to do it then I'd love to hear about it!