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.

142 lines
7.3 KiB

  1. #ifndef _MULPRSHT_H
  2. #define _MULPRSHT_H
  3. #include "idlcomm.h" // for HIDA
  4. #include "ids.h"
  5. // we recycle this string from the printer stringtable in shell32.rc
  6. #define IDS_UNKNOWNERROR IDS_PRTPROP_UNKNOWNERROR
  7. #define IDT_SIZE 1
  8. // file attribute state
  9. typedef struct
  10. {
  11. DWORD fReadOnly; // each dword is one of BST_CHECKED, BST_UNCHECKED, or BST_INDETERMINATE
  12. DWORD fHidden;
  13. DWORD fArchive;
  14. DWORD fIndex;
  15. DWORD fCompress;
  16. DWORD fEncrypt;
  17. DWORD fRecordingEnabled;
  18. } ATTRIBUTESTATE;
  19. typedef struct _FILEPROPSHEETPAGE FILEPROPSHEETPAGE;
  20. // FOLDERCONTENTSINFO includes members which are referenced across UI Thread and Size Thread.
  21. typedef struct {
  22. LONG _cRef;
  23. BOOL fIsSizeThreadAlive;
  24. HWND hDlg;
  25. BOOL bContinue; // tell thread to stop or mark as done
  26. ULONGLONG cbSize; // total size of all files in folder
  27. ULONGLONG cbActualSize; // total size on disk, taking into account compression and cluster slop
  28. DWORD dwClusterSize; // the size of a cluster
  29. int cFiles; // # files in folder
  30. int cFolders; // # folders in folder
  31. TCHAR szPath[MAX_PATH];
  32. WIN32_FIND_DATA fd; // for thread stack savings
  33. HIDA hida;
  34. BOOL fMultipleFiles; // are there multiple files?
  35. BOOL fIsCompressionAvailable; // is comrpession supported on the volume?
  36. ULARGE_INTEGER ulTotalNumberOfBytes; // total # of bytes to apply attributes to (for progress dlg)
  37. } FOLDERCONTENTSINFO;
  38. typedef struct _FILEPROPSHEETPAGE
  39. {
  40. PROPSHEETPAGE psp;
  41. BOOL fMountedDrive; // Are we dealing with a mounted drive or not?
  42. BOOL fIsLink; // Is this a .lnk file?
  43. //the following fields are used by both the structures
  44. HWND hDlg;
  45. TCHAR szPath[MAX_PATH]; // full path to the file (single file case)
  46. LPITEMIDLIST pidl; // pidl for the item == NULL if not initialized
  47. TCHAR szLinkTarget[MAX_PATH]; // full path of link target (if the file is a .lnk)
  48. ATTRIBUTESTATE asInitial; // initial file attribute state
  49. ATTRIBUTESTATE asCurrent; // current file attribute state
  50. BOOL fIsEncryptionAvailable; // is encryption supported on the volume?
  51. BOOL fIsIndexAvailable; // is conten indexing supported in the filesystem?
  52. //This is used only by the single file dialog proc
  53. LPVOID pAssocStore; // pointer to the Association Store, we use it to query type info
  54. IProgressDialog* pProgressDlg; // pointer to the IProgressDialog object
  55. ULARGE_INTEGER ulNumberOfBytesDone; // # of bytes that we have already applied attribs to (for progress dlg)
  56. FOLDERCONTENTSINFO* pfci; // the background size thread fills this structure with size info
  57. WIN32_FIND_DATA fd; // info about the file we are currently applying attribs to
  58. HWND hwndTip; // window handle for location tooltip
  59. HDPA hdpaBadFiles; // this dpa holds the names of the files that we dont want to apply attribs to
  60. TCHAR szInitialName[MAX_PATH]; // the original "short" name we display in the edit box
  61. BOOL fWMInitFinshed; // are we finished processing the WM_INITDIALOG message (needed for rename)
  62. BOOL fRecursive; // should we recurse into subdirs when applying attributes?
  63. BOOL fIsDirectory; // is this file a directory (in multiple files case: are any of the files a directory?)
  64. BOOL fIsExe; // if this is an .exe, we ask if they want to support user logon
  65. BOOL fRename; // has the user renamed the file/folder?
  66. BOOL fIgnoreAllErrors; // has the user hit "ignore all" to the error message?
  67. BOOL fShowExtension; // are we showing the real extension for this file in the name editbox?
  68. BOOL fFolderShortcut;
  69. int cItemsDone; // Number of items we have already applied attribs to (for progress dlg)
  70. BOOL fDisableRename; // Should the name edit box be disabled?
  71. //The following is used only by the mounted drv dialog proc
  72. int iDrive; // Drive id of the mounted drive if there is one
  73. TCHAR szFileSys[48]; // file system name.
  74. BOOL fCanRename; // is the name a valid name for renaming?
  75. // Folder shortcut specific stuff.
  76. LPITEMIDLIST pidlTarget;
  77. BOOL fValidateEdit;
  78. } FILEPROPSHEETPAGE;
  79. typedef struct
  80. {
  81. PROPSHEETPAGE psp;
  82. HWND hDlg;
  83. //szDrive will contain the mountpoint (e.g. c:\ or c:\folder\folder2\)
  84. TCHAR szDrive[MAX_PATH];
  85. int iDrive;
  86. _int64 qwTot;
  87. _int64 qwFree;
  88. DWORD dwPieShadowHgt;
  89. ULARGE_INTEGER ulTotalNumberOfBytes; // total # of bytes to apply attributes to (for progress dlg)
  90. ATTRIBUTESTATE asInitial; // initial attribute state
  91. ATTRIBUTESTATE asCurrent; // current attribute state
  92. BOOL fIsCompressionAvailable; // is file-based compression available on this volume (NTFS?)
  93. BOOL fIsIndexAvailable; // is content indexing available on this volume?
  94. BOOL fRecursive; // should we recurse into subdirs when applying attributes?
  95. BOOL fMountedDrive; // is the proppage invoked from mounted point proppage
  96. } DRIVEPROPSHEETPAGE;
  97. typedef struct
  98. {
  99. LPCTSTR pszPath;
  100. DWORD dwLastError;
  101. } ATTRIBUTEERROR;
  102. STDAPI_(BOOL) ApplyFileAttributes(LPCTSTR pszPath, FILEPROPSHEETPAGE* pfpsp, HWND hWndParent, BOOL* pbSomethingChanged);
  103. STDAPI_(BOOL) ApplySingleFileAttributes(FILEPROPSHEETPAGE* pfpsp);
  104. STDAPI_(BOOL_PTR) CALLBACK RecursivePromptDlgProc(HWND hDlgRecurse, UINT uMessage, WPARAM wParam, LPARAM lParam);
  105. STDAPI_(void) SetDateTimeText(HWND hdlg, int id, const FILETIME *pftUTC);
  106. STDAPI_(void)SetDateTimeTextEx(HWND hdlg, int id, const FILETIME *pftUTC, DWORD dwFlags);
  107. STDAPI_(DWORD) GetVolumeFlags(LPCTSTR pszPath, OUT OPTIONAL LPTSTR pszFileSys, int cchFileSys);
  108. STDAPI_(void) SetInitialFileAttribs(FILEPROPSHEETPAGE* pfpsp, DWORD dwFlags, DWORD dwMask);
  109. BOOL_PTR CALLBACK AdvancedFileAttribsDlgProc(HWND hDlgAttribs, UINT uMessage, WPARAM wParam, LPARAM lParam);
  110. STDAPI_(void) SetDlgItemTextWithToolTip(HWND hDlg, UINT id, LPCTSTR pszText, HWND *phwndTT);
  111. STDAPI_(FOLDERCONTENTSINFO*) Create_FolderContentsInfo();
  112. STDAPI_(LONG) AddRef_FolderContentsInfo(FOLDERCONTENTSINFO *pfci);
  113. STDAPI_(LONG) Release_FolderContentsInfo(FOLDERCONTENTSINFO *pfci);
  114. STDAPI InitCommonPrsht(FILEPROPSHEETPAGE *pfpsp);
  115. STDAPI FolderSize(LPCTSTR pszDir, FOLDERCONTENTSINFO * pfci);
  116. #endif // _MULPRSHT_H