I suspect the error 87 should be ignored as you have not checked if the previous function was successful or not. You can validate that by calling SetLastError(0) before the SetIcon() call. You also say that when you set icon style to FALSE it does not display the icon; isn't that what it should do?
I have managed to get my XP VM set up and have run a number of tests but cannot make this work. Having a look around with Google it seems that this feature does not work on XP, despite the fact that the MSDN documentation states that this should work on versions from Windows 2000 and above. It looks like you are stuck, and the only solution is to decide whether to use text or icon in your product.