//----------------------------------------------------------
// unit1.h
class TForm1 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
void __fastcall WMQueryEndSession(TWMQueryEndSession &msg);
public: // User declarations
__fastcall TForm1(TComponent* Owner);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_QUERYENDSESSION,TWMQueryEndSession,WMQueryEndSession)
END_MESSAGE_MAP(TForm)
};
//----------------------------------------------------------
//----------------------------------------------------------
// unit1.cpp
void __fastcall TForm1::WMQueryEndSession(TWMQueryEndSession &msg)
{
msg.Result = 0;
ShowMessage("Lo siento, no tengo ganas de apagarme" ) ;
}