////////////////////////////////////////////////////////////////////////// // 基础api函数的定义; #ifndef __UNDERLYING_API_20150817__ #define __UNDERLYING_API_20150817__ #include "basetype.h" #include #include #include #include #include using namespace Gdiplus; #pragma comment(lib, "gdiplus.lib") #include #pragma comment(lib,"Mpr.lib") #include #pragma comment(lib,"comsuppw.lib") namespace underlyingapi { typedef struct __OS_VER_INFO__ { BOOL bIs64Bit; TCHAR szOSVerName[256]; DWORD dwMajorVersion; // 系统主版本号; DWORD dwMinorVersion; // 系统次版本号; WORD wProductType; // 系统类型; __OS_VER_INFO__() { bIs64Bit = FALSE; ZeroMemory(szOSVerName, MAX_PATH); dwMajorVersion = 0; dwMinorVersion = 0; wProductType = 0; } }OSVerInfo,*pOSVerInfo; extern AFX_API_EXPORT BOOL GetFilePath(TCHAR *FilePath, HWND hParentWnd, TCHAR* InstructionString, UINT ulFlags); extern AFX_API_EXPORT BOOL extmerge(IN CONST TString& ext1, IN CONST TString& ext2, IN TString &merge); extern AFX_API_EXPORT INT iscorrectext(IN const TString &fext, OUT TString* lpMistakenExt = NULL); extern AFX_API_EXPORT BOOL IsStringExist(IN CString& str, IN CStringArray &tagAry); extern AFX_API_EXPORT BOOL IsStringExist(IN TString& str, IN STR_VEC &tagVt); extern AFX_API_EXPORT BOOL IsStringExistNoCase(IN CString& str, IN CStringArray &tagAry); extern AFX_API_EXPORT BOOL IsStringExistNoCase(IN CONST TString& str, IN STR_VEC &tagVt); extern AFX_API_EXPORT TString lowercase(IN const TString &Str); extern AFX_API_EXPORT TString uppercase(IN const TString &Str); extern AFX_API_EXPORT int match(IN CONST TString &sExt, IN CONST TString &sFile); extern AFX_API_EXPORT void GetDirveInfo(); extern AFX_API_EXPORT void Splitpath(IN CONST TCHAR *path, IN TCHAR * drive, IN size_t driveNumberOfElements, IN TCHAR * dir, IN size_t dirNumberOfElements, IN CONST int &nTimes); extern AFX_API_EXPORT BOOL CreateDirectoryEx(IN LPCTSTR lpNewDirectory); extern AFX_API_EXPORT BOOL OpenFloder(IN STR_VEC &vtFiles,IN LPCTSTR lpFilter = NULL); extern AFX_API_EXPORT BOOL OpenFloder(IN CStringArray &vtFiles,IN LPCTSTR lpFilter = NULL); extern AFX_API_EXPORT BOOL IsValidpath(IN CONST TString &strPath); ////////////////////////////////////////////////////////////////////////// extern AFX_API_EXPORT int GetEncoderClsid(IN CONST WCHAR* format, OUT CLSID* pClsid); extern AFX_API_EXPORT BOOL SaveImg2newfile(IN Image* pImg, IN CString strNewfile, IN ULONG uQuality); extern AFX_API_EXPORT BOOL SaveImg2newfile(IN Image* pImg, IN TString strNewfile, IN ULONG uQuality); extern AFX_API_EXPORT int ZoomImg(IN CRect &Imgrc, IN CONST DWORD &dwDisplayPix, OUT DWORD &dwZoomPix); extern AFX_API_EXPORT int ZoomImg(IN CONST DWORD &dwImgPix, IN CONST DWORD &dwDisplayPix, OUT DWORD &dwZoomPix); extern AFX_API_EXPORT BOOL ImgThumbnail(IN Image* pImg, IN CONST DWORD &dwDisplayPix, IN CString strNewfile, IN ULONG uQuality); extern AFX_API_EXPORT BOOL ImgThumbnail(IN LPCTSTR lpImgpath, IN CONST DWORD &dwDisplayPix, IN CString strNewfile, IN ULONG uQuality); extern AFX_API_EXPORT BOOL ImgThumbnail(IN CONST TString &strImgpath, IN CONST DWORD &dwDisplayPix, IN TString strNewfile, IN ULONG uQuality); extern AFX_API_EXPORT BOOL SimpleImgThumbnail(IN LPCWSTR lpImgpath, IN CONST DWORD &dwDisplayPix, IN CString strNewfile, IN ULONG uQuality); extern AFX_API_EXPORT BOOL GetDiskSpaceInfo(IN LPCTSTR lpRootPathName,IN OUT double &dTotalNum, IN OUT double &dFreeNum); // 获取计算机操作系统版本; extern AFX_API_EXPORT INT GetNativeSystemInfo(LPTSTR lpSystemName); extern AFX_API_EXPORT BOOL IsWow64(); extern AFX_API_EXPORT BOOL IsOSVerIs64(); extern AFX_API_EXPORT INT IsWow64Process( HANDLE hprocess ); extern AFX_API_EXPORT BOOL GetSystemInfo(OSVerInfo &tagOSInfo); }; #endif