Change this to:
Process p _ notifyicon _ add (pwnd: cardinal; PuID: integer; PuCallMsg: cardinal; Picon: cardinal; PTip:Pchar);
Then there is the assignment of this sentence:
notifyicon . SZ tip:= PTip; //'gadget set';
Change to:
move(ptip^,notifyicon.sztip,64);
That should do it. When you adjust it, just send a "gadget set".
In addition: it is not good for you to put it in one unit. If you can, you'd better write it as a control. However, the third-party pallet control has existed for a long time, and all versions above Delphi2006 will have their own pallet control. So you can repackage your own learning and use Delphi components directly.