urlshell.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 7k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. #ifndef _URLSHELL_H_
  2. #define _URLSHELL_H_
  3. // This header is an extraction of private macros and prototypes that
  4. // originally came from shellp.h and shellprv.h.  
  5. #define DATASEG_READONLY   DATA_SEG_READ_ONLY
  6. #ifndef DebugMsg                                                                /* ;Internal */
  7. #define DM_TRACE    0x0001      // Trace messages                               /* ;Internal */
  8. #define DM_WARNING  0x0002      // Warning                                      /* ;Internal */
  9. #define DM_ERROR    0x0004      // Error                                        /* ;Internal */
  10. #define DM_ASSERT   0x0008      // Assertions                                   /* ;Internal */
  11. #define Assert(f)                                                               /* ;Internal */
  12. #define AssertE(f)      (f)                                                     /* ;Internal */
  13. #define AssertMsg   1 ? (void)0 : (void)                                        /* ;Internal */
  14. #define DebugMsg    1 ? (void)0 : (void)                                        /* ;Internal */
  15. #endif                                                                          /* ;Internal */
  16. #define ARRAYSIZE(a)    (sizeof(a)/sizeof(a[0]))
  17. #define ENTERCRITICAL   Shell_EnterCriticalSection();
  18. #define LEAVECRITICAL   Shell_LeaveCriticalSection();
  19. void Shell_EnterCriticalSection(void);
  20. void Shell_LeaveCriticalSection(void);
  21. #define CCH_KEYMAX      64          // DOC: max size of a reg key (under shellex)
  22. #define FillExecInfo(_info, _hwnd, _verb, _file, _params, _dir, _show) 
  23.         (_info).hwnd            = _hwnd;        
  24.         (_info).lpVerb          = _verb;        
  25.         (_info).lpFile          = _file;        
  26.         (_info).lpParameters    = _params;      
  27.         (_info).lpDirectory     = _dir;         
  28.         (_info).nShow           = _show;        
  29.         (_info).fMask           = 0;            
  30.         (_info).cbSize          = SIZEOF(SHELLEXECUTEINFO);
  31. // Define some registry caching apis.  This will allow us to minimize the
  32. // changes needed in the shell code and still try to reduce the number of
  33. // calls that we make to the registry.
  34. LONG SHRegQueryValueA(HKEY hKey,LPCSTR lpSubKey,LPSTR lpValue,PLONG lpcbValue);
  35. LONG SHRegQueryValueExA(HKEY hKey,LPCSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
  36. LONG SHRegQueryValueW(HKEY hKey,LPCWSTR lpSubKey,LPWSTR lpValue,PLONG lpcbValue);
  37. LONG SHRegQueryValueExW(HKEY hKey,LPCWSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);
  38. #define GCD_MUSTHAVEOPENCMD     0x0001
  39. #define GCD_ADDEXETODISPNAME    0x0002  // must be used with GCD_MUSTHAVEOPENCMD
  40. #define GCD_ALLOWPSUDEOCLASSES  0x0004  // .ext type extensions
  41. // Only valid when used with FillListWithClasses
  42. #define GCD_MUSTHAVEEXTASSOC    0x0008  // There must be at least one extension assoc
  43. #define DECLAREWAITCURSOR  HCURSOR hcursor_wait_cursor_save
  44. #define SetWaitCursor()   hcursor_wait_cursor_save = SetCursor(LoadCursor(NULL, IDC_WAIT))
  45. #define ResetWaitCursor() SetCursor(hcursor_wait_cursor_save)
  46. // indexes into the shell image lists (Shell_GetImageList) for default images
  47. // If you add to this list, you also need to update II_LASTSYSICON!
  48. #define II_DOCNOASSOC         0         // document (blank page) (not associated)
  49. #define II_APPLICATION        2         // application (exe, com, bat)
  50. WINSHELLAPI BOOL  WINAPI Shell_GetImageLists(HIMAGELIST *phiml, HIMAGELIST *phimlSmall);
  51. WINSHELLAPI int   WINAPI Shell_GetCachedImageIndex(LPCTSTR pszIconPath, int iIconIndex, UINT uIconFlags);
  52. WINSHELLAPI int   WINAPI PickIconDlg(HWND hwnd, LPSTR pszIconPath, UINT cbIconPath, int *piIconIndex);
  53. WINSHELLAPI BOOL  WINAPI GetFileNameFromBrowse(HWND hwnd, LPSTR szFilePath, UINT cbFilePath, LPCSTR szWorkingDir, LPCSTR szDefExt, LPCSTR szFilters, LPCSTR szTitle);
  54. WINSHELLAPI void WINAPI PathGetShortPath(LPTSTR pszLongPath);
  55. WINSHELLAPI BOOL WINAPI PathYetAnotherMakeUniqueName(LPTSTR  pszUniqueName, LPCTSTR pszPath, LPCTSTR pszShort, LPCTSTR pszFileSpec);
  56. extern DWORD WINAPI GetExeType(LPCTSTR pszFile);
  57. WINSHELLAPI LPITEMIDLIST WINAPI SHSimpleIDListFromPath(LPCTSTR pszPath);
  58. WINSHELLAPI void          WINAPI ILFree(LPITEMIDLIST pidl);
  59. //
  60. // Path processing function
  61. //
  62. #define PPCF_ADDQUOTES               0x00000001        // return a quoted name if required
  63. #define PPCF_ADDARGUMENTS            0x00000003        // appends arguments (and wraps in quotes if required)
  64. #define PPCF_NODIRECTORIES           0x00000010        // don't match to directories
  65. #define PPCF_NORELATIVEOBJECTQUALIFY 0x00000020        // don't return fully qualified relative objects
  66. #define PPCF_FORCEQUALIFY            0x00000040        // qualify even non-relative names
  67. WINSHELLAPI LONG WINAPI PathProcessCommand( LPCTSTR lpSrc, LPTSTR lpDest, int iMax, DWORD dwFlags );
  68. // PathResolve flags
  69. #define PRF_VERIFYEXISTS            0x0001
  70. #define PRF_TRYPROGRAMEXTENSIONS    (0x0002 | PRF_VERIFYEXISTS)
  71. #define PRF_FIRSTDIRDEF             0x0004
  72. #define PRF_DONTFINDLNK             0x0008      // if PRF_TRYPROGRAMEXTENSIONS is specified
  73. WINSHELLAPI int   WINAPI PathResolve(LPTSTR lpszPath, LPCTSTR FAR dirs[], UINT fFlags);
  74. //======Hash Item=============================================================
  75. typedef struct _HashTable * PHASHTABLE;
  76. #define PHASHITEM LPCTSTR
  77. typedef void (CALLBACK *HASHITEMCALLBACK)(PHASHTABLE pht, LPCTSTR sz, UINT wUsage, DWORD param);
  78. LPCTSTR      WINAPI FindHashItem  (PHASHTABLE pht, LPCTSTR lpszStr);
  79. LPCTSTR      WINAPI AddHashItem   (PHASHTABLE pht, LPCTSTR lpszStr);
  80. LPCTSTR      WINAPI DeleteHashItem(PHASHTABLE pht, LPCTSTR lpszStr);
  81. LPCTSTR      WINAPI PurgeHashItem (PHASHTABLE pht, LPCTSTR lpszStr);
  82. #define     GetHashItemName(pht, sz, lpsz, cch)  lstrcpyn(lpsz, sz, cch)
  83. PHASHTABLE  WINAPI CreateHashItemTable(UINT wBuckets, UINT wExtra, BOOL fCaseSensitive);
  84. void        WINAPI DestroyHashItemTable(PHASHTABLE pht);
  85. void        WINAPI SetHashItemData(PHASHTABLE pht, LPCTSTR lpszStr, int n, DWORD dwData);
  86. DWORD       WINAPI GetHashItemData(PHASHTABLE pht, LPCTSTR lpszStr, int n);
  87. void *      WINAPI GetHashItemDataPtr(PHASHTABLE pht, LPCTSTR lpszStr);
  88. void        WINAPI EnumHashItems(PHASHTABLE pht, HASHITEMCALLBACK callback, DWORD dwParam);
  89. #ifdef DEBUG
  90. void        WINAPI DumpHashItemTable(PHASHTABLE pht);
  91. #endif
  92. #ifndef SIZEOF
  93. #define SIZEOF(a)                   sizeof(a)
  94. #endif
  95. #ifndef ARRAYSIZE
  96. #define ARRAYSIZE(a)                (sizeof(a)/sizeof(a[0]))
  97. #endif
  98. #define PATH_CCH_EXT                64
  99. #endif // _URLSHELL_H_