1
0

MiniVersion.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // MiniVersion.h Version 1.1
  2. //
  3. // Author: Hans Dietrich
  4. // [email protected]
  5. //
  6. // This software is released into the public domain.
  7. // You are free to use it in any way you like, except
  8. // that you may not sell this source code.
  9. //
  10. // This software is provided "as is" with no expressed
  11. // or implied warranty. I accept no liability for any
  12. // damage or loss of business that this software may cause.
  13. //
  14. ///////////////////////////////////////////////////////////////////////////////
  15. #ifndef MINIVERSION_H
  16. #define MINIVERSION_H
  17. #include <windows.h>
  18. #include <TCHAR.h>
  19. class CMiniVersion
  20. {
  21. // constructors
  22. public:
  23. CMiniVersion(LPCTSTR lpszPath = NULL);
  24. BOOL Init();
  25. void Release();
  26. // operations
  27. public:
  28. // attributes
  29. public:
  30. // fixed info
  31. BOOL GetFileVersion(WORD *pwVersion);
  32. BOOL GetProductVersion(WORD* pwVersion);
  33. BOOL GetFileFlags(DWORD& rdwFlags);
  34. BOOL GetFileOS(DWORD& rdwOS);
  35. BOOL GetFileType(DWORD& rdwType);
  36. BOOL GetFileSubtype(DWORD& rdwType);
  37. // string info
  38. BOOL GetCompanyName(LPTSTR lpszCompanyName, int nSize);
  39. BOOL GetFileDescription(LPTSTR lpszFileDescription, int nSize);
  40. BOOL GetProductName(LPTSTR lpszProductName, int nSize);
  41. // implementation
  42. protected:
  43. BOOL GetFixedInfo(VS_FIXEDFILEINFO& rFixedInfo);
  44. BOOL GetStringInfo(LPCTSTR lpszKey, LPTSTR lpszValue, unsigned int cchBuffer);
  45. BYTE* m_pData;
  46. DWORD m_dwHandle;
  47. WORD m_wFileVersion[4];
  48. WORD m_wProductVersion[4];
  49. DWORD m_dwFileFlags;
  50. DWORD m_dwFileOS;
  51. DWORD m_dwFileType;
  52. DWORD m_dwFileSubtype;
  53. TCHAR m_szPath[MAX_PATH*2];
  54. TCHAR m_szCompanyName[MAX_PATH*2];
  55. TCHAR m_szProductName[MAX_PATH*2];
  56. TCHAR m_szFileDescription[MAX_PATH*2];
  57. };
  58. ///////////////////////////////////////////////////////////////////////////////
  59. #endif