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.

228 lines
6.8 KiB

  1. //****************************************************************************
  2. //
  3. // Module: mmsys.cpl
  4. // File: subobj.h
  5. // Content: This file contains the subobject (our own object)
  6. // storage space and manipulation mechanisms.
  7. //
  8. // History:
  9. // 06/94 VijR Created
  10. //
  11. // Copyright (c) Microsoft Corporation 1991-1994
  12. //
  13. //****************************************************************************
  14. #ifndef _SUBOBJ_H_
  15. #define _SUBOBJ_H_
  16. // This structure is used as the LPITEMIDLIST that
  17. // the shell uses to identify objects in a folder. The
  18. // first two bytes are required to indicate the size,
  19. // the rest of the data is opaque to the shell.
  20. typedef struct _SUBOBJ
  21. {
  22. USHORT cbSize; // Size of this struct
  23. UINT uFlags; // One of SOF_ values
  24. short nIconIndex;
  25. short iSort;
  26. short iOffsetIconFile;
  27. short iOffsetDesc;
  28. short iOffsetClass;
  29. short iOffsetExtPropFile;
  30. short iOffsetExtPropFunc;
  31. short iOffsetExtCLSID;
  32. short iOffsetPlayCmdLn;
  33. short iOffsetOpenCmdLn;
  34. short iOffsetNewCmdLn;
  35. HICON hClassIcon;
  36. struct _SUBOBJ FAR * psoNext;
  37. TCHAR szName[1]; // Display name
  38. } SUBOBJ, FAR * PSUBOBJ;
  39. // LPCTSTR Subobj_GetName(PSUBOBJ pso);
  40. //
  41. // Gets the subobject name.
  42. //
  43. #define Subobj_GetName(pso) ((pso)->szName)
  44. // UINT Subobj_GetFlags(PSUBOBJ pso);
  45. //
  46. // Gets the subobject flags.
  47. //
  48. #define Subobj_GetFlags(pso) ((pso)->uFlags)
  49. // int Subobj_GetIconIndex(PSUBOBJ pso);
  50. //
  51. // Gets the subobject icon.
  52. //
  53. #define Subobj_GetIconIndex(pso) ((pso)->nIconIndex)
  54. // LPTSTR Subobj_GetIconFile(PSUBOBJ pso);
  55. //
  56. // Gets the subobject icon Index in file.
  57. //
  58. #define Subobj_GetIconFile(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetIconFile))
  59. // LPTSTR Subobj_GetDesc(PSUBOBJ pso);
  60. //
  61. // Gets the subobject IconFile name.
  62. //
  63. #define Subobj_GetDesc(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetDesc))
  64. // LPTSTR Subobj_GetClass(PSUBOBJ pso);
  65. //
  66. // Gets the subobject Clas Name
  67. //
  68. #define Subobj_GetClass(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetClass))
  69. // int Subobj_GetSortIndex(PSUBOBJ pso);
  70. //
  71. // Gets the subobject Sort order.
  72. //
  73. #define Subobj_GetSortIndex(pso) ((pso)->iSort)
  74. // HICON Subobj_GetClassIcon(PSUBOBJ pso);
  75. //
  76. // Gets the subobject Object Icon.
  77. //
  78. #define Subobj_GetClassIcon(pso) ((pso)->hClassIcon)
  79. // LPTSTR Subobj_GetExtPropFile(PSUBOBJ pso);
  80. //
  81. // Gets the subobject External Class File.
  82. //
  83. #define Subobj_GetExtPropFile(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetExtPropFile))
  84. // LPTSTR Subobj_GetExtPropFunc(PSUBOBJ pso);
  85. //
  86. // Gets the subobject External Class Func.
  87. //
  88. #define Subobj_GetExtPropFunc(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetExtPropFunc))
  89. // LPTSTR Subobj_GetExtCLSID(PSUBOBJ pso);
  90. //
  91. // Gets the subobject external CLSID.
  92. //
  93. #define Subobj_GetExtCLSID(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetExtCLSID))
  94. // LPTSTR Subobj_GetPlayCmdLn(PSUBOBJ pso);
  95. //
  96. // Gets the subobject command line
  97. //
  98. #define Subobj_GetPlayCmdLn(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetPlayCmdLn))
  99. // LPTSTR Subobj_GetOpenCmdLn(PSUBOBJ pso);
  100. //
  101. // Gets the subobject command line
  102. //
  103. #define Subobj_GetOpenCmdLn(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetOpenCmdLn))
  104. // LPTSTR Subobj_GetNewCmdLn(PSUBOBJ pso);
  105. //
  106. // Gets the subobject command line.
  107. //
  108. #define Subobj_GetNewCmdLn(pso) ((LPTSTR)((pso)->szName + (pso)->iOffsetNewCmdLn))
  109. // Some other Subobj functions...
  110. //
  111. BOOL PUBLIC Subobj_New(PSUBOBJ FAR * ppso, LPCTSTR pszClass, LPCTSTR pszName, LPCTSTR pszDesc, LPCTSTR pszIconFile, LPCTSTR pszExtPropFile,
  112. LPCTSTR pszExtPropFunc,LPCTSTR pszExtCLSID, LPCTSTR pszPlayCmdLn, LPCTSTR pszOpenCmdLn,
  113. LPCTSTR pszNewCmdLn,short nIconIndex, UINT uFlags, short iSort);
  114. void PUBLIC Subobj_Destroy(PSUBOBJ pso);
  115. BOOL PUBLIC Subobj_Dup(PSUBOBJ FAR * ppso, PSUBOBJ psoArgs);
  116. #ifdef DEBUG
  117. void PUBLIC Subobj_Dump(PSUBOBJ pso);
  118. #endif
  119. typedef struct _SUBOBJSPACE
  120. {
  121. PSUBOBJ psoFirst;
  122. PSUBOBJ psoLast;
  123. int cItems;
  124. int cRef;
  125. } SUBOBJSPACE, FAR * PSUBOBJSPACE;
  126. // PSUBOBJ Sos_FirstItem(void);
  127. //
  128. // Returns the first object in the subobject space. NULL if empty.
  129. //
  130. #define Sos_FirstItem(psos) (psos->psoFirst)
  131. // PSUBOBJ Sos_NextItem(PSUBOBJ pso);
  132. //
  133. // Returns the next object in the subobject space. NULL if no more
  134. // objects.
  135. //
  136. #define Sos_NextItem(pso) (pso ? pso->psoNext : NULL)
  137. // Other subobject space functions
  138. //
  139. PSUBOBJ PUBLIC Sos_FindItem(PSUBOBJSPACE psos, LPCTSTR pszName);
  140. BOOL PUBLIC Sos_AddItem(PSUBOBJSPACE psos, PSUBOBJ pso);
  141. USHORT PUBLIC Sos_GetMaxSize(PSUBOBJSPACE psos);
  142. PSUBOBJ PUBLIC Sos_RemoveItem(PSUBOBJSPACE psos, LPCTSTR pszName);
  143. void PUBLIC Sos_Destroy(PSUBOBJSPACE psos);
  144. int PUBLIC Sos_FillFromRegistry(PSUBOBJSPACE psos, LPITEMIDLIST pidl);
  145. BOOL PUBLIC Sos_Init(PSUBOBJSPACE psos, LPITEMIDLIST pidl, BOOL fAdvancedFolder);
  146. HRESULT PUBLIC Sos_AddRef(PSUBOBJSPACE psos, LPITEMIDLIST pidl, BOOL fAdvancedFolder);
  147. void PUBLIC Sos_Release(PSUBOBJSPACE psos);
  148. #define SOF_ISFOLDER 0x0001
  149. #define SOF_ISDROPTARGET 0x0002
  150. #define SOF_CANDELETE 0x0004
  151. #define SOF_HASEXTPROPSHEET 0x0008
  152. #define SOF_ISEXTOBJECT 0x0010
  153. #define SOF_DOESPLAY 0x0020
  154. #define SOF_DOESOPEN 0x0040
  155. #define SOF_DOESNEW 0x0080
  156. #define SOUNDEVENTS TEXT("Sound Events")
  157. #define WAVE TEXT("Wave")
  158. #define MIDI TEXT("MIDI")
  159. #define MIXER TEXT("Mixer")
  160. #define AUX TEXT("Aux")
  161. #define ACM TEXT("ACM")
  162. #define ICM TEXT("ICM")
  163. #define MCI TEXT("MCI")
  164. #define AUDIO TEXT("Audio")
  165. #define CDAUDIO TEXT("CDAudio")
  166. #define VIDEO TEXT("Video")
  167. #define VOICE TEXT("Voice")
  168. #define ADVANCEDFOLDER TEXT("Advanced Folder")
  169. #ifdef DEBUG
  170. void PUBLIC Sos_DumpList(void);
  171. #endif
  172. //extern SUBOBJSPACE g_sos;
  173. //
  174. // Other prototypes...
  175. //
  176. HRESULT PUBLIC mmseObj_CreateInstance(LPSHELLFOLDER psf, UINT cidl, BOOL fInAdvancedFolder, LPCITEMIDLIST FAR * ppidl, LPCITEMIDLIST pidlRoot, LPSHELLVIEW csv, REFIID riid, LPVOID FAR * ppvOut);
  177. HRESULT NEAR PASCAL mmseView_Command(LPSHELLVIEW psv, HWND hwnd, UINT uID);
  178. LPTSTR PUBLIC lmemset(LPTSTR dst, char val, UINT count);
  179. LPTSTR PUBLIC lmemmove(LPTSTR dst, LPTSTR src, int count);
  180. int PUBLIC AnsiToInt(LPCTSTR pszString);
  181. int PUBLIC DoModal (HWND hwndParent, DLGPROC lpfnDlgProc, UINT uID, LPARAM lParam);
  182. HMENU PUBLIC LoadPopupMenu(UINT id, UINT uSubOffset);
  183. UINT PUBLIC MergePopupMenu(HMENU FAR *phMenu, UINT idResource, UINT uSubOffset, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast);
  184. HMENU PUBLIC GetMenuFromID(HMENU hmMain, UINT uID);
  185. #endif // _SUBOBJ_H_