#ifndef __GLOBAL_WECHAT__
#define __GLOBAL_WECHAT__

#include <tlhelp32.h>
#include <vector>
#include <string>
using namespace std;

#ifdef UNICODE
typedef wstring TString;
#else
typedef string TString;
#endif

#define WECHAT _T("WeChat.exe")

// 全局变量;
extern TCHAR g_szModulePath[MAX_PATH];			// 软件目录;
extern TCHAR g_szModuleFileName[MAX_PATH];		// 软件名称;
extern TCHAR g_szIniFile[MAX_PATH];

// 配置文件信息;
extern TCHAR g_szServAddress[MAX_PATH];		
extern DWORD g_dwServPort;					
extern TCHAR g_szAccount[MAX_PATH];			
extern TCHAR g_szPassword[MAX_PATH];		
extern TCHAR g_szWeChatPath[MAX_PATH];		
extern TCHAR g_szCacheDir[MAX_PATH];	
extern TCHAR g_szDynamicLibraryPath[MAX_PATH];


// 控制台输出;
extern BOOL g_bStdOut;

extern int GetIniInfo(LPCTSTR lpIniDir = NULL, LPCTSTR lpIniName = NULL);
extern DWORD FindProcess(LPCTSTR lpProName);
extern vector<DWORD> FindAllProcess(LPCTSTR lpProName);
extern HANDLE FindModule(LPCTSTR lpModuleName, DWORD dwPID);
extern HANDLE FindModuleEx(LPCTSTR lpModuleName, DWORD dwPid);
extern BOOL GetDebugPriv();

extern BOOL GetFileVersion( IN HMODULE hModule, IN DWORD (&dwArray)[4]);
extern BOOL GetFileVersionEx( IN LPCTSTR lpFileName, IN DWORD (&dwArray)[4] );
extern BOOL GetProductVersion( IN HMODULE hModule, IN DWORD (&dwArray)[4]);
extern BOOL GetProductVersionEx( IN LPCTSTR lpFileName, IN DWORD (&dwArray)[4] );

extern BOOL GetOSDisplayString(LPTSTR pszOS);
extern void WriteTextLog(const TCHAR *format, ...);
extern BOOL CopyFileEx(LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, const BOOL &bFailIfExists=TRUE);
extern void tSplitpath(const char *path, char *drive, char *dir, char *fname, char *ext);
extern void tSplitpath(const char *path, char *drive, char *dir, const int &nTimes);
extern BOOL IsDirectoryLegitimate(const CString &strDirectory);
extern void ShowSystemErrorInfo(CString strDescription, const DWORD &dwError);
extern BOOL MySystemShutdown(LPTSTR lpMsg);
extern BOOL PreventSystemShutdown();
extern BOOL MySystemShutdown();


//////////////////////////////////////////////////////////////////////////
extern BOOL getWeChatPath();
extern BOOL OpenWeChat();

#endif