//---------------------------------------------------------------------------
#ifndef CtrlDogH
#define CtrlDogH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ScktComp.hpp>
#include <ExtCtrls.hpp>
#include <Menus.hpp>
//#include "Phantom.hpp"
#include "DigitNum.h"
#include <Graphics.hpp>
//---------------------------------------------------------------------------
#define MYWM_NOTIFY         (WM_APP+100)
#define IDC_MYICON                     1006
extern HINSTANCE g_hinst;
LRESULT IconDrawItem(LPDRAWITEMSTRUCT lpdi);
//---------------------------------------------------------------------------
class TDog : public TForm
{
__published:	// IDE-managed Components
    TMemo *Memo1;
    TStatusBar *StatusBar1;
    TServerSocket *ServerSocket;
    TTimer *Timer1;
    TTimer *Reloj;
    TDigitNum *Dig1;
    TShape *Shape2;
    TShape *Shape1;
    TDigitNum *Dig2;
    TImage *Image1;
    TBevel *Bevel1;
    TBevel *Bevel2;
    TBevel *Bevel3;
    TBevel *Bevel4;
    TLabel *Label1;
    TLabel *Label2;
    TPopupMenu *PopupMenu1;
    TMenuItem *Tiemporestante1;
    TMenuItem *Status1;
    TMenuItem *CerrarWindows1;
    TMenuItem *N1;
    TTimer *SystemLock;
    void __fastcall ServerSocketAccept(TObject *Sender,
          TCustomWinSocket *Socket);
    void __fastcall ServerSocketClientConnect(TObject *Sender,
          TCustomWinSocket *Socket);

    void __fastcall ServerSocketClientDisconnect(TObject *Sender,
          TCustomWinSocket *Socket);
    void __fastcall ServerSocketClientError(TObject *Sender,
          TCustomWinSocket *Socket, TErrorEvent ErrorEvent,
          int &ErrorCode);
    void __fastcall ServerSocketGetSocket(TObject *Sender, int Socket,
          TServerClientWinSocket *&ClientSocket);
    void __fastcall ServerSocketListen(TObject *Sender,
          TCustomWinSocket *Socket);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall Timer1Timer(TObject *Sender);
    void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
    void __fastcall FormShow(TObject *Sender);
    
    void __fastcall RelojTimer(TObject *Sender);
    void __fastcall Label1DblClick(TObject *Sender);
    
    void __fastcall Tiemporestante1Click(TObject *Sender);
    void __fastcall Status1Click(TObject *Sender);
    void __fastcall CerrarWindows1Click(TObject *Sender);
    void __fastcall FormDestroy(TObject *Sender);
    
    void __fastcall SystemLockTimer(TObject *Sender);
    
    void __fastcall Shape2MouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
    
    
    
    void __fastcall FormResize(TObject *Sender);
    void __fastcall Shape1MouseUp(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
    void __fastcall FormClick(TObject *Sender);
    
    void __fastcall Label2Click(TObject *Sender);
private:	// User declarations

    bool __fastcall MyExitWindows( unsigned int flags );
    TDateTime Tiempo, TiempoInicio;
    bool AllowClose;
    void __fastcall SetState( bool OnOff );

    void __fastcall DrawItem(TMessage& Msg);
    void __fastcall MyNotify(TMessage& Msg);
    bool __fastcall TrayMessage(DWORD dwMessage);
    void __fastcall ObtenListaAplicaciones(void);

    HANDLE __fastcall IconHandle(void);
    PSTR __fastcall TipText(void);

    void __fastcall HookAutoStartProgram(void);
    void __fastcall iLockSystem( bool status );
    void __fastcall DisableTaskMgr(bool bTF);

    void __fastcall HideOpt( int Option, bool Hide );

public:		// User declarations
    void __fastcall AppRestore(TObject *Sender);
    bool CanBeDisconect;
    __fastcall TDog(TComponent* Owner);
    bool TryClose;

BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_DRAWITEM,TMessage,DrawItem)
MESSAGE_HANDLER(MYWM_NOTIFY,TMessage,MyNotify)
END_MESSAGE_MAP(TForm)

};
//---------------------------------------------------------------------------
TStringList *siMinimizar, *noMinimizar, *snMinimizar, *noAbrir;
//---------------------------------------------------------------------------
extern PACKAGE TDog *Dog;
//---------------------------------------------------------------------------
#endif
 