Good evening

I have a small problem. Basically, I want to pass the method pointer for the function PaintProc into the Register... function. But Delphi won't let me. Here is my code:
[pascal]type
TMessageHandler = function(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT of object;

TThing = class(TObject)
protected
function PaintProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;

function RegisterMessageHandler(Msg: UINT; Handler: TMessageHandler): TMessageHandler;
public
constructor Create;
end;

...

constructor TThing.Create;
begin
RegisterMessageHandler(WM_PAINT, PaintProc); // this doesn't work
RegisterMessageHandler(WM_PAINT, @PaintProc); // or this...
end;[/pascal]