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.

208 lines
5.8 KiB

  1. /*****************************************************************************\
  2. * *
  3. * shell.h - SHELL.DLL functions, types, and definitions *
  4. * *
  5. * Copyright (c) 1993-1994, Microsoft Corp. All rights reserved *
  6. * *
  7. \*****************************************************************************/
  8. #ifndef _INC_SHELL
  9. #define _INC_SHELL
  10. #include <commctrl.h> // for ImageList_ and other this depends on
  11. #include <shellapi.h>
  12. #ifndef RC_INVOKED
  13. #pragma pack(1) /* Assume byte packing throughout */
  14. #endif /* !RC_INVOKED */
  15. #ifdef __cplusplus
  16. extern "C" { /* Assume C declarations for C++ */
  17. #endif /* __cplusplus */
  18. //====== Ranges for WM_NOTIFY codes ==================================
  19. // Note that these are defined to be unsigned to avoid compiler warnings
  20. // since NMHDR.code is declared as UINT.
  21. // NM_FIRST - NM_LAST defined in commctrl.h (0U-0U) - (OU-99U)
  22. // LVN_FIRST - LVN_LAST defined in commctrl.h (0U-100U) - (OU-199U)
  23. // PSN_FIRST - PSN_LAST defined in prsht.h (0U-200U) - (0U-299U)
  24. // HDN_FIRST - HDN_LAST defined in commctrl.h (0U-300U) - (OU-399U)
  25. // TVN_FIRST - TVN_LAST defined in commctrl.h (0U-400U) - (OU-499U)
  26. #define RDN_FIRST (0U-500U)
  27. #define RDN_LAST (0U-519U)
  28. // TTN_FIRST - TTN_LAST defined in commctrl.h (0U-520U) - (OU-549U)
  29. #define SEN_FIRST (0U-550U)
  30. #define SEN_LAST (0U-559U)
  31. #define EXN_FIRST (0U-1000U) // shell explorer/browser
  32. #define EXN_LAST (0U-1199U)
  33. #define MAXPATHLEN MAX_PATH
  34. #ifndef FO_MOVE //these need to be kept in sync with the ones in shlobj.h
  35. #define FO_MOVE 0x0001
  36. #define FO_COPY 0x0002
  37. #define FO_DELETE 0x0003
  38. #define FO_RENAME 0x0004
  39. #define FOF_CREATEPROGRESSDLG 1
  40. #define FOF_CONFIRMMOUSE 2
  41. #define FOF_SILENT 4 // don't create progress/report
  42. #define FOF_RENAMEONCOLLISION 8
  43. #define FOF_NOCONFIRMATION 16 // Don't prompt the user.
  44. #define FOF_WANTMAPPINGHANDLE 32 // Fill in SHFILEOPSTRUCT.hNameMappings
  45. // Must be freed using SHFreeNameMappings
  46. typedef WORD FILEOP_FLAGS;
  47. #endif // FO_MOVE
  48. // implicit parameters are:
  49. // if pFrom or pTo are unqualified names the current directories are
  50. // taken from the global current drive/directory settings managed
  51. // by Get/SetCurrentDrive/Directory
  52. //
  53. // the global confirmation settings
  54. typedef struct _SHFILEOPSTRUCT
  55. {
  56. HWND hwnd;
  57. UINT wFunc;
  58. LPCSTR pFrom;
  59. LPCSTR pTo;
  60. FILEOP_FLAGS fFlags;
  61. BOOL fAnyOperationsAborted;
  62. LPVOID hNameMappings;
  63. } SHFILEOPSTRUCT, FAR *LPSHFILEOPSTRUCT;
  64. int WINAPI SHFileOperation(LPSHFILEOPSTRUCT lpFileOp);
  65. void WINAPI SHFreeNameMappings(HANDLE hNameMappings);
  66. typedef struct _SHNAMEMAPPING
  67. {
  68. LPSTR pszOldPath;
  69. LPSTR pszNewPath;
  70. int cchOldPath;
  71. int cchNewPath;
  72. } SHNAMEMAPPING, FAR *LPSHNAMEMAPPING;
  73. #define SHGetNameMappingCount(_hnm) \
  74. DSA_GetItemCount(_hnm)
  75. #define SHGetNameMappingPtr(_hnm, _iItem) \
  76. (LPSHNAMEMAPPING)DSA_GetItemPtr(_hnm, _iItem)
  77. /* util.c */
  78. #define Shell_Initialize() (TRUE)
  79. #define Shell_Terminate() (TRUE)
  80. #define STRREG_SHEX "shellex"
  81. #ifdef WIN32
  82. //===================================================================
  83. // Hotkey management API's
  84. // Set the pending hotkey for the given app,
  85. // The next top level window to be created by the given app will be given
  86. // this hotkey.
  87. BOOL WINAPI SHSetPendingHotkey(LPCSTR lpszPath, WORD wHotkey);
  88. // Check the list of pending hotkeys and change the first occurence
  89. // of lpszFrom to lpszTo
  90. BOOL WINAPI SHChangePendingHotkey(LPCSTR lpszFrom, LPCSTR lpszTo);
  91. // Delete all pending hotkeys.
  92. void WINAPI SHDeleteAllPendingHotkeys(void);
  93. // Set the hotkey for the given instance of an app.
  94. BOOL WINAPI SHSetHotkeyByInstance(HINSTANCE hinst, WORD wHotkey);
  95. // Delete a pending instance.
  96. BOOL WINAPI SHDeletePendingHotkey(LPCSTR lpszPath);
  97. // Get a pending hotkey given a path.
  98. WORD WINAPI SHGetPendingHotkey(LPCSTR lpszPath);
  99. #endif
  100. typedef struct _SHELLEXECUTEINFO
  101. {
  102. DWORD cbSize;
  103. HWND hwnd;
  104. LPCSTR lpVerb;
  105. LPCSTR lpFile;
  106. LPCSTR lpParameters;
  107. LPCSTR lpDirectory;
  108. LPCSTR lpClass;
  109. int nShow;
  110. LPVOID lpReserved;
  111. HINSTANCE hInstApp;
  112. } SHELLEXECUTEINFO, FAR *LPSHELLEXECUTEINFO;
  113. BOOL WINAPI ShellExecuteEx(LPSHELLEXECUTEINFO lpExecInfo);
  114. void WINAPI WinExecError(HWND hwnd, int error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
  115. // Hint flags for ShellFileClass
  116. #define SFC_UNKNOWN 0x0000
  117. #define SFC_FILE 0x0001
  118. #define SFC_DIRECTORY 0x0002
  119. #define SFC_SYSTEM 0x0004
  120. #define SFC_TYPEMASK (SFC_FILE|SFC_DIRECTORY|SFC_SYSTEM)
  121. #define SFC_EXIST 0x4000 // We already know that this one exists
  122. #define SFC_FULLYQUALIFIED 0x8000 // lpFile is fully qualified path.
  123. int WINAPI ShellFileClass(LPCSTR lpFile, UINT wFlags,
  124. LPSTR lpszClassName, UINT cbClassName);
  125. #define EIRESID(x) (-1 * (int)(x))
  126. UINT WINAPI ExtractIconEx(LPCSTR lpszFile, int nIconIndex,
  127. HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  128. // Tray notification definitions
  129. typedef struct _NOTIFYICONDATA
  130. {
  131. DWORD cbSize;
  132. HWND hWnd;
  133. UINT uID;
  134. UINT uFlags;
  135. UINT uCallbackMessage;
  136. HICON hIcon;
  137. char szTip[64];
  138. } NOTIFYICONDATA, *PNOTIFYICONDATA;
  139. #define NIM_ADD 0x00000000
  140. #define NIM_MODIFY 0x00000001
  141. #define NIM_DELETE 0x00000002
  142. #define NIF_MESSAGE 0x00000001
  143. #define NIF_ICON 0x00000002
  144. #define NIF_TIP 0x00000004
  145. BOOL WINAPI Shell_NotifyIcon(DWORD dwMessage, PNOTIFYICONDATA lpData);
  146. #ifdef __cplusplus
  147. }
  148. #endif /* __cplusplus */
  149. #ifndef RC_INVOKED
  150. #pragma pack()
  151. #endif /* !RC_INVOKED */
  152. #endif // !_INC_SHELL