To detect and prevent shutdown the computer I use very simple program. It has only one form and one private procedure like below:
TForm3 = class(TForm) priva
This looks like a bug in Delphi. I suggest you to post this on Quality Central.