To do this you use the TrFile_GetIcon function. It can create icons in sizes varying from 16×16 to 1024×1024 pixels and even with double resolution for retina screens.
You can get the icon like this:
FileMaker is a powerful database, but it cannot do everything. Luckily you can extent FileMaker Pro with plug-ins. Troi Automatisering has been creating several plug-ins since 1995.
FileMaker plug-ins can be found here: