//--------------------------------------------------------------------------- #ifndef AppGlobalFH #define AppGlobalFH //--------------------------------------------------------------------------- #include #include "ITSUtilF.h" #include "ITSLogF.h" //--------------------------------------------------------------------------- /* ****************************************************************************** * Defines ****************************************************************************** */ #define FORMSHOW(x) if (x) \ { \ try { \ ShowWindow(x->Handle, SW_RESTORE); \ x->BringToFront(); \ } catch(...) {} \ } \ else \ { \ Application->CreateForm(__classid(T##x), &x); \ if (x) x->Show(); \ } typedef struct tag_AppConfig { String sConfigFile; bool bAppClose; long lMainWinHandle; /* Main Window Handle */ String sTitle; String sProcessId; /* ÇÁ·Î¼¼½º ID */ int nVmsServerPort; String sSkinName; bool bSaveForm; bool bLoginPrompt; String sDefUseId; int nLogLevel; AnsiString sLogDay; bool bDebug; String sAppPath; String sLang; String sEmptyImg; bool isDispOfflineMsg; struct { bool Window; bool Enabled; int TimeOut; } Alarm; struct { bool Window; bool Enabled; int TimeOut; } Incident; struct { int AlarmValue; } Temp; struct { bool Enabled; int IntervalMin; bool LogoutExit; } AutoLogout; struct { TThread *pThread; DWORD dwThreadId; unsigned int nHandle; bool bRunning; } thr; struct { String sConnectStr; String sProvider; String sServerName; String sUserName; String sPassword; bool bSqlLog; } itsdb; struct { String sProvider; String sServerName; String sUserName; String sPassword; bool bSqlLog; } utisdb; struct { String sMainMap; String sLinkMap; } flashmap; struct { String sComModel; String sDevModel; } vmscam; struct { String saveDir; String viewer; String server; int port; String user; String pswd; String dir; } blackbox; struct { String SERVER; int PORT; String USER; String PSWD; bool PASSIVE; } vmsFtp; bool bOnlyOneScreen; bool bTermChildProg; bool isLoadFromFile; String MAGIC_ID; String OPER_ID; String PRCS_ID; String PARAM1; String PARAM2; String PARAM3; String PARAM4; } APP_CONFIG; #define DEFAULT_PRCS_ID "P08010" /* ****************************************************************************** * Global variable definitions ****************************************************************************** */ extern String g_IniFileDir; extern String g_IniFileName; extern int g_nPid; // Application Process ID extern String g_sAppDir; // Application Directory extern String g_sAppName; // Program name extern String g_sCfgDir; // Config File Directory extern String g_sLogDir; // Program Log Directory extern String g_sTempDir; // Program Temp Directory extern String g_sFormsDir; // Program Forms Directory extern String g_sBlackBox; extern String g_sLangDir; extern String g_sImageDir; extern String g_sVideoDir; extern String g_sMapDir; extern LOG_INFO g_LogCfg; extern TITSLog *ITSLog; extern APP_CONFIG g_AppCfg; //extern LOG_INFO g_LogCfg; //extern TITSLog *ITSLog; extern String g_sLang; extern bool g_bControlAuth; /* ****************************************************************************** * PlugIn Global variables ****************************************************************************** */ /* ****************************************************************************** * Global function definitios ****************************************************************************** */ String DbPictTypeToReal(String APictType); String RealPictTypeToDb(String APictType); String DbMovieTypeToReal(String APictType); String RealMovieTypeToDb(String APictType); bool CheckApplicationParam(); bool ApplicationSingleRun(String AClassName, String ATitle); bool LoadDefaultConfigInfo(String ACfgFile=""); bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue); bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue); bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile); void ShowErrorMsg(String ATitle, String AErrMsg); #include "cxControls.hpp" #include "cxDropDownEdit.hpp" TDateTime APP_StrToDateTime(String AStrDateTime); //---------------------------------------------------------------------------- ULONG ProcIDFromWnd(HWND hwnd); HWND GetWinHandle(ULONG pid); #endif