Когда-то ещё вроде пробовал так:
#pas
procedure THICallback._work_doCreateHook;
function WndHandleCallback(HWnd: THandle; Msg: Cardinal; WParam, LParam: Integer): Cardinal; stdcall;
begin
...........
end;
begin
begin
if FWndHandle = 0 then
begin
FWndHandle := ReadInteger(_Data,_data_Handle);
FEnabledCallbak := true;
SetWindowLong(FWndHandle, GWL_USERDATA,
SetWindowLong(FWndHandle, GWL_WNDPROC, LongInt(@WndHandleCallback)));
end
else exit;
end;