Leaked source code of windows server 2003
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.

209 lines
5.2 KiB

  1. /*++
  2. Copyright (c) 1990-1998, Microsoft Corporation All rights reserved.
  3. Module Name:
  4. fileopen.h
  5. Abstract:
  6. This module contains the header information for the Win32 fileopen
  7. dialogs.
  8. Revision History:
  9. --*/
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. //
  14. // Include Files.
  15. //
  16. #include <help.h>
  17. //
  18. // Constant Declarations.
  19. //
  20. #define MAX_DISKNAME 260
  21. #define TOOLONGLIMIT MAX_PATH
  22. #define MAX_FULLPATHNAME 520 // 260 + 260
  23. #define WARNINGMSGLENGTH MAX_FULLPATHNAME
  24. #define ERROR_NO_DISK_IN_CDROM 92L
  25. #define ERROR_NO_DISK_IN_DRIVE 93L
  26. #define ERROR_DIR_ACCESS_DENIED 94L
  27. #define ERROR_FILE_ACCESS_DENIED 95L
  28. #define ERROR_CREATE_NO_MODIFY 96L
  29. #define ERROR_NO_DRIVE 97L
  30. #define ERROR_PORTNAME 98L
  31. #define ERROR_LAZY_READONLY 99L
  32. //
  33. // Internal Flags.
  34. //
  35. // Be sure to update OFN_ALL_INTERNAL_FLAGS if more internal flags are
  36. // added.
  37. //
  38. #define OFN_ALL_INTERNAL_FLAGS 0xf8000000 // Keep this in sync
  39. #define OFN_PREFIXMATCH 0x80000000 // Internal
  40. #define OFN_DIRSELCHANGED 0x40000000 // Internal
  41. #define OFN_DRIVEDOWN 0x20000000 // Internal
  42. #define OFN_FILTERDOWN 0x10000000 // Internal
  43. // CD_WX86APP is 0x08000000 // Internal
  44. //
  45. // Used with OFN_COMBODOWN.
  46. //
  47. #define MYCBN_DRAW 0x8000
  48. #define MYCBN_LIST 0x8001
  49. #define MYCBN_REPAINT 0x8002
  50. #define MYCBN_CHANGEDIR 0x8003
  51. #define OFN_OFFSETTAG 0x0001
  52. #define FILEPROP (LPCTSTR) 0xA000L
  53. #define CHANGEDIR_FAILED -1
  54. #define ADDDISK_NOCHANGE -1
  55. #define ADDDISK_INVALIDPARMS -2
  56. #define ADDDISK_MAXNUMDISKS -3
  57. #define ADDDISK_NETFORMATFAILED -4
  58. #define ADDDISK_ALLOCFAILED -5
  59. #define ATTR_READONLY 0x0000001 // GetFileAttributes flag
  60. #define mskFile 0x0000 // List files
  61. #define mskDirectory 0x0010 // List directories
  62. #define mskUNCName 0x0020 // Note UNC directory
  63. #define mskDrives 0xC000 // List drives ONLY
  64. #define rgbSolidGreen 0x0000FF00
  65. #define rgbSolidBlue 0x00FF0000
  66. #define dxSpace 4
  67. #define SUCCESS 0x0
  68. #define FAILURE 0x1
  69. #define DBL_BSLASH(sz) \
  70. (*(TCHAR *)(sz) == CHAR_BSLASH) && \
  71. (*(TCHAR *)((sz) + 1) == CHAR_BSLASH)
  72. #ifdef UNICODE
  73. #define ISBACKSLASH(szPath, nOffset) (szPath[nOffset] == CHAR_BSLASH)
  74. #define ISBACKSLASH_P(szPath, pPos) (*pPos == CHAR_BSLASH)
  75. #else
  76. #define ISBACKSLASH(szPath, nOffset) (IsBackSlash(szPath, szPath + nOffset))
  77. #define ISBACKSLASH_P(szPath, pPos) (IsBackSlash(szPath, pPos))
  78. #endif
  79. //
  80. // Constant used in FILEOPENINFO to specify the version of
  81. // the structure passed by the application.//
  82. #define OPENFILEVERSION_NT4 0x0004
  83. #define OPENFILEVERSION_NT5 0x0005
  84. #define OPENFILEVERSION 0x0005 //Current Version if NT5
  85. //
  86. // Typedef Declarations.
  87. //
  88. typedef struct _OFN_ANSI_STRING {
  89. ULONG Length;
  90. ULONG MaximumLength;
  91. LPSTR Buffer;
  92. } OFN_ANSI_STRING;
  93. typedef OFN_ANSI_STRING *POFN_ANSI_STRING;
  94. typedef struct _OFN_UNICODE_STRING {
  95. ULONG Length;
  96. ULONG MaximumLength;
  97. LPWSTR Buffer;
  98. } OFN_UNICODE_STRING;
  99. typedef OFN_UNICODE_STRING *POFN_UNICODE_STRING;
  100. typedef struct {
  101. UINT ApiType;
  102. LPOPENFILENAME pOFN;
  103. TCHAR szCurDir[MAX_FULLPATHNAME + 1];
  104. TCHAR szPath[MAX_FULLPATHNAME];
  105. TCHAR szSpecCur[MAX_FULLPATHNAME];
  106. TCHAR szLastFilter[MAX_FULLPATHNAME + 1];
  107. DWORD idirSub;
  108. //Version of structure.
  109. DWORD iVersion;
  110. #ifdef UNICODE
  111. LPOPENFILENAMEA pOFNA;
  112. POFN_UNICODE_STRING pusCustomFilter;
  113. POFN_ANSI_STRING pasCustomFilter;
  114. BOOL bUseNewDialog;
  115. #endif
  116. } OPENFILEINFO;
  117. typedef OPENFILEINFO * POPENFILEINFO;
  118. typedef OPENFILEINFO * LPOPENFILEINFO;
  119. void StoreFileSizeInOFN(LPOPENFILENAME pOFN, UINT cch);
  120. void StorePathOrFileSizeInOFN(LPOPENFILENAME pOFN, LPTSTR pszPath);
  121. //
  122. // Function Prototypes.
  123. //
  124. BOOL NewGetOpenFileName(LPOPENFILEINFO lpOFI);
  125. BOOL NewGetSaveFileName(LPOPENFILEINFO lpOFI);
  126. STDAPI_(void) GetAppOpenDir(LPTSTR pszOut, DWORD cchOut, LPITEMIDLIST *ppidl);
  127. STDAPI_(BOOL) FoundFilterMatch(LPCTSTR pszIn, BOOL bLFN);
  128. #ifdef UNICODE
  129. VOID
  130. ThunkOpenFileNameA2WDelayed(
  131. POPENFILEINFO pOFI);
  132. BOOL
  133. ThunkOpenFileNameA2W(
  134. POPENFILEINFO pOFI);
  135. BOOL
  136. ThunkOpenFileNameW2A(
  137. POPENFILEINFO pOFI);
  138. #else
  139. VOID
  140. EliminateString(
  141. LPSTR lpStr,
  142. int nLen);
  143. BOOL
  144. IsBackSlash(
  145. LPSTR lpStart,
  146. LPSTR lpChar);
  147. #endif
  148. #ifdef __cplusplus
  149. }; // extern "C"
  150. #endif