• Viernes 19 de Abril de 2024, 12:38

Autor Tema:  No Dejar Que Windows Se Apague  (Leído 1851 veces)

_Viktor

  • Miembro MUY activo
  • ***
  • Mensajes: 271
    • Ver Perfil
    • http://AyudaCBuilder.foros.st
No Dejar Que Windows Se Apague
« en: Sábado 6 de Diciembre de 2003, 03:16 »
0
Esto servira para aplicaciones que no deben dejar que el pc se apague....
No abusen de el !!!!!!

Código: Text
  1.  
  2.  
  3. //----------------------------------------------------------
  4. // unit1.h
  5. class TForm1 : public TForm
  6. {
  7. __published:   // IDE-managed Components
  8. private:   // User declarations
  9.     void __fastcall WMQueryEndSession(TWMQueryEndSession &msg);
  10. public:      // User declarations
  11.     __fastcall TForm1(TComponent* Owner);
  12.  
  13. BEGIN_MESSAGE_MAP
  14.   MESSAGE_HANDLER(WM_QUERYENDSESSION,TWMQueryEndSession,WMQueryEndSession)
  15. END_MESSAGE_MAP(TForm)
  16. };
  17. //----------------------------------------------------------
  18.  
  19.  
  20. //----------------------------------------------------------
  21. // unit1.cpp
  22. void __fastcall TForm1::WMQueryEndSession(TWMQueryEndSession &msg)
  23. {
  24.     msg.Result = 0;
  25.     ShowMessage("Lo siento, no tengo ganas de apagarme" ) &#59;
  26. }
  27.  
  28.  
_Viktor _Yañez_
"Ser inteligente no es ser mas, solo equivocarse menos y no usar visual basic"

http]

i_berbeu

  • Nuevo Miembro
  • *
  • Mensajes: 11
    • Ver Perfil
Re: No Dejar Que Windows Se Apague
« Respuesta #1 en: Viernes 23 de Septiembre de 2005, 00:59 »
0
a ver si me puedes explicar para que vale esto

BEGIN_MESSAGE_MAP
 MESSAGE_HANDLER(WM_QUERYENDSESSION,TWMQueryEndSession,WMQueryEndSession)
END_MESSAGE_MAP(TForm)

gracias