Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.8 KiB

  1. #ifndef __IMGFILE_H__
  2. #define __IMGFILE_H__
  3. // This is a little helper class for writing things to temporary files
  4. // and giving them the correct name after the save suceeds...
  5. //
  6. class CFileSaver
  7. {
  8. public:
  9. CFileSaver(const TCHAR* szFileName); // setup and create temp names
  10. ~CFileSaver(); // make sure temp files are gone
  11. BOOL CanSave() const; // checks for R/O
  12. const TCHAR* GetSafeName() const // return name of file to create
  13. { return m_strTempName; }
  14. const TCHAR* GetRealName() const // return name of final file
  15. { return m_strName; }
  16. BOOL Finish(); // rename new file as original
  17. private:
  18. CString m_strName;
  19. CString m_strBackupName;
  20. CString m_strTempName;
  21. static const TCHAR BASED_CODE c_szAps [];
  22. };
  23. struct ICONFILEHEADER
  24. {
  25. WORD icoReserved;
  26. WORD icoResourceType;
  27. WORD icoResourceCount;
  28. };
  29. struct ICONDIRENTRY
  30. {
  31. BYTE nWidth;
  32. BYTE nHeight;
  33. BYTE nColorCount;
  34. BYTE bReserved;
  35. WORD wReserved1;
  36. WORD wReserved2;
  37. DWORD icoDIBSize;
  38. DWORD icoDIBOffset;
  39. };
  40. struct CURSORFILEHEADER
  41. {
  42. WORD curReserved;
  43. WORD curResourceType;
  44. WORD curResourceCount;
  45. };
  46. struct CURSORDIRENTRY
  47. {
  48. BYTE nWidth;
  49. BYTE nHeight;
  50. WORD wReserved;
  51. WORD curXHotspot;
  52. WORD curYHotspot;
  53. DWORD curDIBSize;
  54. DWORD curDIBOffset;
  55. };
  56. extern int MkPath(TCHAR *szPath);
  57. extern void MkFullPath(CString& strFullPath, const CString& strRelPath,
  58. BOOL bPathOnly = FALSE);
  59. extern BOOL OpenSubFile(CFile& file, const CFileSaver& saver, UINT nOpenFlags,
  60. CFileException* pError = NULL);
  61. /////////////////////////////////////////////////////////////////////////
  62. #endif // __IMGFILE_H__