Once again I have some bad news for you. Free Pascal is a clone of the Turbo Pascal programming IDE. It's basically a DOS programming environment, with some Windows extensions. And these extentions are not designed for Windows XP and up, but Windows 3.x type OS's. This means that there is no concept of registry (not in DOS or Windows).
This is why developing a Windows app in FPC is difficult, because it is a DOS development environment. That said, you can develop Windows apps.
Like I said, DOS apps do not have Icons and they do not need registry.
Sorry, again. ;)
--- edit ---
I did take a look on the net for you and found a reference to something that might point you in the right direction; not sure if the person was using Lazarus or just FPC, but they are using Windows API calls.
PS: they also say the code is not working, feel free to mail me if you need any help with that. email@example.com