Thank you for answering. I couldnt test yet, because the compiler complains "Error: Can't open resource file". And, actually, Lazarus is frozen. This happens often, I don't know if others have this problem. I run Lazarus 1.6.2 on Linux.
I will try your solution as soon as I have time for it.