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.

2610 lines
94 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: mmc.idl
  8. //
  9. //--------------------------------------------------------------------------
  10. // mmc.idl : IDL source for mmc.exe
  11. //
  12. cpp_quote("#ifndef MMC_VER")
  13. cpp_quote("#define MMC_VER 0x0200")
  14. cpp_quote("#endif")
  15. import "basetsd.h";
  16. import "oaidl.idl";
  17. ///////////////////////////////////////////////////////////////////////////////
  18. /// Interfaces implemented by the Common Console's Node Manager
  19. interface IConsole;
  20. interface IHeaderCtrl;
  21. interface IToolbar;
  22. interface IImageList;
  23. interface IResultData;
  24. interface IConsoleNameSpace;
  25. interface IPropertySheetProvider;
  26. interface IPropertySheetCallback;
  27. interface IContextMenuProvider;
  28. interface IContextMenuCallback;
  29. interface IControlbar;
  30. interface IConsoleVerb;
  31. interface IMenuButton;
  32. cpp_quote("#if (MMC_VER >= 0x0110)")
  33. interface IConsole2;
  34. interface IHeaderCtrl2;
  35. interface IConsoleNameSpace2;
  36. interface IDisplayHelp;
  37. interface IStringTable;
  38. cpp_quote("#endif // MMC_VER >= 0x0110")
  39. cpp_quote("#if (MMC_VER >= 0x0120)")
  40. interface IColumnData;
  41. cpp_quote("#endif // MMC_VER >= 0x0120")
  42. cpp_quote("#if (MMC_VER >= 0x0200)")
  43. interface IConsole3;
  44. interface IConsolePower;
  45. interface INodeProperties;
  46. interface IResultData2;
  47. cpp_quote("#endif // MMC_VER >= 0x0200")
  48. ///////////////////////////////////////////////////////////////////////////////
  49. /// Interfaces implemented by the Snap-in server
  50. interface IComponent;
  51. interface IComponentData;
  52. interface IExtendPropertySheet;
  53. interface IExtendContextMenu;
  54. interface IExtendControlbar;
  55. interface IResultDataCompare;
  56. interface ISnapinAbout;
  57. interface IResultOwnerData;
  58. interface ISnapinHelp;
  59. cpp_quote("#if (MMC_VER >= 0x0110)")
  60. interface IEnumTASK;
  61. interface IExtendPropertySheet2;
  62. interface ISnapinHelp2;
  63. interface IExtendTaskPad;
  64. interface IRequiredExtensions;
  65. cpp_quote("#endif // MMC_VER >= 0x0110")
  66. cpp_quote("#if (MMC_VER >= 0x0120)")
  67. interface IResultDataCompareEx;
  68. cpp_quote("#endif // MMC_VER >= 0x0120")
  69. cpp_quote("#if (MMC_VER >= 0x0200)")
  70. interface IComponent2;
  71. interface IComponentData2;
  72. interface IExtendView;
  73. interface IViewExtensionCallback;
  74. interface IConsolePowerSink;
  75. interface IConsole3;
  76. interface INodeProperties;
  77. interface IResultData2;
  78. cpp_quote("#endif // MMC_VER >= 0x0200")
  79. ///////////////////////////////////////////////////////////////////////////////
  80. /// Type definitions
  81. typedef IConsole* LPCONSOLE;
  82. typedef IHeaderCtrl* LPHEADERCTRL;
  83. typedef IToolbar* LPTOOLBAR;
  84. typedef IImageList* LPIMAGELIST;
  85. typedef IResultData* LPRESULTDATA;
  86. typedef IConsoleNameSpace* LPCONSOLENAMESPACE;
  87. typedef IPropertySheetProvider* LPPROPERTYSHEETPROVIDER;
  88. typedef IPropertySheetCallback* LPPROPERTYSHEETCALLBACK;
  89. typedef IContextMenuProvider* LPCONTEXTMENUPROVIDER;
  90. typedef IContextMenuCallback* LPCONTEXTMENUCALLBACK;
  91. typedef IControlbar* LPCONTROLBAR;
  92. typedef IConsoleVerb* LPCONSOLEVERB;
  93. typedef IMenuButton* LPMENUBUTTON;
  94. cpp_quote("#if (MMC_VER >= 0x0110)")
  95. typedef IConsole2* LPCONSOLE2;
  96. typedef IHeaderCtrl2* LPHEADERCTRL2;
  97. typedef IConsoleNameSpace2* LPCONSOLENAMESPACE2;
  98. typedef IDisplayHelp* LPDISPLAYHELP;
  99. typedef IStringTable* LPSTRINGTABLE;
  100. cpp_quote("#endif // MMC_VER >= 0x0110")
  101. cpp_quote("#if (MMC_VER >= 0x0120)")
  102. typedef IColumnData* LPCOLUMNDATA;
  103. typedef IResultDataCompareEx* LPRESULTDATACOMPAREEX;
  104. cpp_quote("#endif // MMC_VER >= 0x0120")
  105. typedef IComponent* LPCOMPONENT;
  106. typedef IComponentData* LPCOMPONENTDATA;
  107. typedef IExtendPropertySheet* LPEXTENDPROPERTYSHEET;
  108. typedef IExtendContextMenu* LPEXTENDCONTEXTMENU;
  109. typedef IExtendControlbar* LPEXTENDCONTROLBAR;
  110. typedef IResultDataCompare* LPRESULTDATACOMPARE;
  111. typedef IResultOwnerData* LPRESULTOWNERDATA;
  112. typedef ISnapinAbout* LPSNAPABOUT;
  113. typedef ISnapinAbout* LPSNAPINABOUT;
  114. typedef ISnapinHelp* LPSNAPHELP;
  115. typedef ISnapinHelp* LPSNAPINHELP;
  116. cpp_quote("#if (MMC_VER >= 0x0110)")
  117. typedef IEnumTASK* LPENUMTASK;
  118. typedef IExtendPropertySheet2* LPEXTENDPROPERTYSHEET2;
  119. typedef ISnapinHelp2* LPSNAPINHELP2;
  120. typedef IExtendTaskPad* LPEXTENDTASKPAD;
  121. typedef IRequiredExtensions* LPREQUIREDEXTENSIONS;
  122. cpp_quote("#endif // MMC_VER >= 0x0110")
  123. cpp_quote("#if (MMC_VER >= 0x0200)")
  124. typedef IComponent2* LPCOMPONENT2;
  125. typedef IComponentData2* LPCOMPONENTDATA2;
  126. typedef IExtendView* LPEXTENDVIEW;
  127. typedef IViewExtensionCallback* LPVIEWEXTENSIONCALLBACK;
  128. typedef IConsolePower* LPCONSOLEPOWER;
  129. typedef IConsolePowerSink* LPCONSOLEPOWERSINK;
  130. typedef IConsole3* LPCONSOLE3;
  131. typedef INodeProperties* LPNODEPROPERTIES;
  132. typedef IResultData2* LPRESULTDATA2;
  133. cpp_quote("#endif // MMC_VER >= 0x0200")
  134. // typedefs for external types
  135. typedef BSTR* PBSTR;
  136. ///////////////////////////////////////////////////////////////////////////////
  137. // Published Common Console ListView constants
  138. #define LVS_ICON 0x0000
  139. #define LVS_REPORT 0x0001
  140. #define LVS_SMALLICON 0x0002
  141. #define LVS_LIST 0x0003
  142. #define LVSICF_NOINVALIDATEALL 0x00000001
  143. #define LVSICF_NOSCROLL 0x00000002
  144. const long MMCLV_AUTO = -1;
  145. const long MMCLV_NOPARAM = -2;
  146. const long MMCLV_NOICON = -1;
  147. // If you add a view style please update the VIEW_TYPE in ndmgr.idl
  148. const long MMCLV_VIEWSTYLE_ICON = LVS_ICON;
  149. const long MMCLV_VIEWSTYLE_SMALLICON = LVS_SMALLICON;
  150. const long MMCLV_VIEWSTYLE_LIST = LVS_LIST;
  151. const long MMCLV_VIEWSTYLE_REPORT = LVS_REPORT;
  152. const long MMCLV_VIEWSTYLE_FILTERED = 0x0004;
  153. const void* MMCLV_NOPTR = 0x0;
  154. const long MMCLV_UPDATE_NOINVALIDATEALL = LVSICF_NOINVALIDATEALL;
  155. const long MMCLV_UPDATE_NOSCROLL = LVSICF_NOSCROLL;
  156. static unsigned short* MMC_CALLBACK = ((unsigned short *)(-1));
  157. cpp_quote("#if (MMC_VER >= 0x0120)")
  158. cpp_quote("#define MMC_IMAGECALLBACK (-1)")
  159. cpp_quote("#define MMC_TEXTCALLBACK MMC_CALLBACK")
  160. cpp_quote("#endif // MMC_VER >= 0x0120")
  161. ///////////////////////////////////////////////////////////////////////////////
  162. // ResultData and Scope Data item structures.
  163. typedef LONG_PTR HSCOPEITEM;
  164. typedef long COMPONENTID;
  165. typedef LONG_PTR HRESULTITEM;
  166. const DWORD RDI_STR = 0x0002;
  167. const DWORD RDI_IMAGE = 0x0004;
  168. const DWORD RDI_STATE = 0x0008;
  169. const DWORD RDI_PARAM = 0x0010;
  170. const DWORD RDI_INDEX = 0x0020;
  171. const DWORD RDI_INDENT = 0x0040;
  172. /*
  173. * This is lame. Some view styles should be made available only to clients
  174. * that build with a certain MMC_VER level. Ideally, we'd just put the
  175. * cpp_quote tests around the value definitions in the enumeration.
  176. * MIDL chokes on this, however, so we have this ugly hackery instead. Ugh.
  177. */
  178. cpp_quote("typedef enum _MMC_RESULT_VIEW_STYLE ")
  179. cpp_quote("{ ")
  180. cpp_quote(" MMC_SINGLESEL = 0x0001, ")
  181. cpp_quote(" MMC_SHOWSELALWAYS = 0x0002, ")
  182. cpp_quote(" MMC_NOSORTHEADER = 0x0004, ")
  183. cpp_quote("#if (MMC_VER >= 0x0120) ")
  184. cpp_quote(" MMC_ENSUREFOCUSVISIBLE = 0x0008 ")
  185. cpp_quote("#endif // MMC_VER >= 0x0120 ")
  186. cpp_quote("} MMC_RESULT_VIEW_STYLE; ")
  187. cpp_quote("#if 0")
  188. typedef enum _MMC_RESULT_VIEW_STYLE
  189. {
  190. _MMC_VIEW_STYLE__dummy_
  191. } MMC_RESULT_VIEW_STYLE;
  192. cpp_quote("#endif")
  193. // List view with single select
  194. const long MMC_VIEW_OPTIONS_NONE = 0x00000000;
  195. // NO List view. Only custom views.
  196. const long MMC_VIEW_OPTIONS_NOLISTVIEWS = 0x00000001;
  197. // List view with multi select.
  198. const long MMC_VIEW_OPTIONS_MULTISELECT = 0x00000002;
  199. //List view with user owned data
  200. const long MMC_VIEW_OPTIONS_OWNERDATALIST = 0x00000004;
  201. //List view with filtering allowed
  202. const long MMC_VIEW_OPTIONS_FILTERED = 0x00000008;
  203. // Create new control (don't use cached)
  204. const long MMC_VIEW_OPTIONS_CREATENEW = 0x00000010;
  205. cpp_quote("#if (MMC_VER >= 0x0110)")
  206. // Use font linking on result items (for multi-language support)
  207. const long MMC_VIEW_OPTIONS_USEFONTLINKING = 0x00000020;
  208. cpp_quote("#endif // MMC_VER >= 0x0110")
  209. cpp_quote("#if (MMC_VER >= 0x0120)")
  210. // don't include scope items in the result list view
  211. const long MMC_VIEW_OPTIONS_EXCLUDE_SCOPE_ITEMS_FROM_LIST = 0x00000040;
  212. const long MMC_VIEW_OPTIONS_LEXICAL_SORT = 0x00000080;
  213. cpp_quote("#endif // MMC_VER >= 0x0120")
  214. // Property sheet options
  215. const DWORD MMC_PSO_NOAPPLYNOW = 0x00000001;
  216. const DWORD MMC_PSO_HASHELP = 0x00000002;
  217. const DWORD MMC_PSO_NEWWIZARDTYPE = 0x00000004;
  218. const DWORD MMC_PSO_NO_PROPTITLE = 0x00000008;
  219. // Type of controls that can be attached to the IControlbar
  220. typedef enum _MMC_CONTROL_TYPE
  221. {
  222. TOOLBAR,
  223. MENUBUTTON,
  224. COMBOBOXBAR
  225. } MMC_CONTROL_TYPE;
  226. ///////////////////////////////////////////////////////////////////////////////
  227. // Console commands - These should be reviewed
  228. //
  229. /*
  230. * This is lame. We need to make sure that some notifications are available
  231. * only to clients that build with a certain MMC_VER level. Ideally, we'd just
  232. * put the cpp_quote tests around the value definitions in the enumeration.
  233. * MIDL chokes on this, however, so we have this ugly hackery instead. Ugh.
  234. */
  235. cpp_quote("typedef enum _MMC_CONSOLE_VERB ")
  236. cpp_quote("{ ")
  237. cpp_quote(" MMC_VERB_NONE = 0x0000, ")
  238. cpp_quote(" MMC_VERB_OPEN = 0x8000, ")
  239. cpp_quote(" MMC_VERB_COPY = 0x8001, ")
  240. cpp_quote(" MMC_VERB_PASTE = 0x8002, ")
  241. cpp_quote(" MMC_VERB_DELETE = 0x8003, ")
  242. cpp_quote(" MMC_VERB_PROPERTIES = 0x8004, ")
  243. cpp_quote(" MMC_VERB_RENAME = 0x8005, ")
  244. cpp_quote(" MMC_VERB_REFRESH = 0x8006, ")
  245. cpp_quote(" MMC_VERB_PRINT = 0x8007, ")
  246. cpp_quote("#if (MMC_VER >= 0x0110) ")
  247. cpp_quote(" MMC_VERB_CUT = 0x8008, // Used only to explicitly disable/hide")
  248. cpp_quote(" // the cut verb, when copy & paste are enabled.")
  249. cpp_quote(" ")
  250. cpp_quote(" // must be last ")
  251. cpp_quote(" MMC_VERB_MAX, ")
  252. cpp_quote(" MMC_VERB_FIRST = MMC_VERB_OPEN, ")
  253. cpp_quote(" MMC_VERB_LAST = MMC_VERB_MAX - 1 ")
  254. cpp_quote("#endif // MMC_VER >= 0x0110 ")
  255. cpp_quote("} MMC_CONSOLE_VERB; ")
  256. cpp_quote("#if 0")
  257. typedef enum _MMC_CONSOLE_VERB
  258. {
  259. MMC_VERB__dummy_
  260. } MMC_CONSOLE_VERB;
  261. cpp_quote("#endif")
  262. // Structure to create buttons on the toolbar
  263. cpp_quote("#include <pshpack8.h>")
  264. typedef struct _MMCButton
  265. {
  266. int nBitmap; // Offset into the bitmap list
  267. int idCommand; // Command ID return when the button is clicked
  268. BYTE fsState; // TBSTYLE_ENABLED ..etc
  269. BYTE fsType; // TBSTYLE_BUTTON || TBSTYLE_SEP
  270. LPOLESTR lpButtonText; // Text value for the Button
  271. LPOLESTR lpTooltipText; // Text value for the tooltip
  272. } MMCBUTTON;
  273. cpp_quote("#include <poppack.h>")
  274. typedef MMCBUTTON* LPMMCBUTTON;
  275. typedef enum _MMC_BUTTON_STATE
  276. {
  277. ENABLED = 0x01,
  278. CHECKED = 0x02,
  279. HIDDEN = 0x04,
  280. INDETERMINATE = 0x08,
  281. BUTTONPRESSED = 0x10,
  282. } MMC_BUTTON_STATE;
  283. typedef struct _RESULTDATAITEM
  284. {
  285. DWORD mask;
  286. BOOL bScopeItem;
  287. HRESULTITEM itemID;
  288. int nIndex;
  289. int nCol;
  290. LPOLESTR str;
  291. int nImage;
  292. UINT nState;
  293. LPARAM lParam;
  294. int iIndent;
  295. } RESULTDATAITEM;
  296. typedef RESULTDATAITEM* LPRESULTDATAITEM;
  297. // Find result item options
  298. const DWORD RFI_PARTIAL = 0x0001;
  299. const DWORD RFI_WRAP = 0x0002;
  300. typedef struct _RESULTFINDINFO
  301. {
  302. LPOLESTR psz;
  303. int nStart;
  304. DWORD dwOptions;
  305. }
  306. RESULTFINDINFO;
  307. typedef RESULTFINDINFO* LPRESULTFINDINFO;
  308. //
  309. // Sort Result Items options
  310. //
  311. const DWORD RSI_DESCENDING = 0x0001;
  312. const DWORD RSI_NOSORTICON = 0x0002;
  313. const DWORD SDI_STR = 0x00002;
  314. const DWORD SDI_IMAGE = 0x00004;
  315. const DWORD SDI_OPENIMAGE = 0x00008;
  316. const DWORD SDI_STATE = 0x00010;
  317. const DWORD SDI_PARAM = 0x00020;
  318. const DWORD SDI_CHILDREN = 0x00040;
  319. // The top 4 bit of the mask determines the relative position of this item,
  320. // relative to the SCOPEDATAITEM::relativeID. By default it is the parent.
  321. // For SDI_PARENT, SCOPEDATAITEM::relativeID is the HSCOPEITEM of the parent.
  322. // As you can see by the SDI_PARENT value it is a no-op. Since by default
  323. // SCOPEDATAITEM::relativeID is treated as the parents ID.
  324. const DWORD SDI_PARENT = 0x00000000;
  325. // For SDI_PREVIOUS, SCOPEDATAITEM::relativeID is the HSCOPEITEM of the previous sibling
  326. const DWORD SDI_PREVIOUS = 0x10000000;
  327. // For SDI_NEXT, SCOPEDATAITEM::relativeID is the HSCOPEITEM of the next sibling.
  328. const DWORD SDI_NEXT = 0x20000000;
  329. // For SDI_PARENT, bit 27 determines whether the item is to be inserted as the
  330. // first child. By default this item will inserted as the last child.
  331. const DWORD SDI_FIRST = 0x08000000;
  332. typedef struct _SCOPEDATAITEM
  333. {
  334. DWORD mask;
  335. LPOLESTR displayname;
  336. int nImage;
  337. int nOpenImage;
  338. UINT nState;
  339. int cChildren;
  340. LPARAM lParam;
  341. HSCOPEITEM relativeID;
  342. HSCOPEITEM ID;
  343. } SCOPEDATAITEM;
  344. typedef SCOPEDATAITEM* LPSCOPEDATAITEM;
  345. typedef enum _MMC_SCOPE_ITEM_STATE
  346. {
  347. MMC_SCOPE_ITEM_STATE_NORMAL = 0x0001, // Not bold. To set or get.
  348. MMC_SCOPE_ITEM_STATE_BOLD = 0x0002, // To set or get.
  349. MMC_SCOPE_ITEM_STATE_EXPANDEDONCE = 0x0003, // Only to get.
  350. } MMC_SCOPE_ITEM_STATE;
  351. typedef struct _CONTEXTMENUITEM
  352. {
  353. LPWSTR strName;
  354. LPWSTR strStatusBarText;
  355. LONG lCommandID;
  356. LONG lInsertionPointID;
  357. LONG fFlags;
  358. LONG fSpecialFlags;
  359. } CONTEXTMENUITEM;
  360. typedef CONTEXTMENUITEM* LPCONTEXTMENUITEM;
  361. //
  362. // Console defined menu command IDs
  363. // The console reserves the negative numbers for predefined menu command
  364. // IDs which it sends to a snapin's IExtendContextMenu::Command method
  365. //
  366. typedef enum _MMC_MENU_COMMAND_IDS
  367. {
  368. MMCC_STANDARD_VIEW_SELECT = -1
  369. } MMC_MENU_COMMAND_IDS;
  370. //IMenuButton data structure
  371. typedef struct _MENUBUTTONDATA
  372. {
  373. int idCommand;
  374. int x;
  375. int y;
  376. } MENUBUTTONDATA;
  377. typedef MENUBUTTONDATA* LPMENUBUTTONDATA;
  378. typedef LONG_PTR MMC_COOKIE;
  379. // For multi select the cookie passed to the snapins will be
  380. // MMC_MULTI_SELECT_COOKIE. The data object that will be returned
  381. // should provide the CCF_OBJECT_TYPES_IN_MULTI_SELECT clipboard
  382. // format.
  383. const MMC_COOKIE MMC_MULTI_SELECT_COOKIE = -2;
  384. // Special cookie value for requesting window properties data object
  385. const MMC_COOKIE MMC_WINDOW_COOKIE = -3;
  386. cpp_quote("#if (MMC_VER >= 0x0110)")
  387. const MMC_COOKIE SPECIAL_COOKIE_MIN = -10;
  388. const MMC_COOKIE SPECIAL_COOKIE_MAX = -1;
  389. // Published filter constants
  390. #define HDFT_ISSTRING 0x0000
  391. #define HDFT_ISNUMBER 0x0001
  392. #define HDFT_HASNOVALUE 0x8000
  393. typedef enum _MMC_FILTER_TYPE
  394. {
  395. MMC_STRING_FILTER = HDFT_ISSTRING,
  396. MMC_INT_FILTER = HDFT_ISNUMBER,
  397. MMC_FILTER_NOVALUE= HDFT_HASNOVALUE
  398. } MMC_FILTER_TYPE;
  399. typedef struct _MMC_FILTERDATA
  400. {
  401. LPOLESTR pszText; // text filter value
  402. INT cchTextMax; // max size of filter text
  403. LONG lValue; // numeric filter value
  404. } MMC_FILTERDATA;
  405. typedef enum _MMC_FILTER_CHANGE_CODE
  406. {
  407. MFCC_DISABLE = 0,
  408. MFCC_ENABLE = 1,
  409. MFCC_VALUE_CHANGE = 2
  410. } MMC_FILTER_CHANGE_CODE;
  411. typedef struct _MMC_RESTORE_VIEW
  412. { // data from call to GetResultViewType
  413. DWORD dwSize; // sizeof of this struct for versioning
  414. MMC_COOKIE cookie; // user's cookie
  415. LPOLESTR pViewType; // URL or OCX or NULL
  416. long lViewOptions; // MMC_VIEW_OPTIONS_*
  417. } MMC_RESTORE_VIEW;
  418. typedef struct _MMC_EXPANDSYNC_STRUCT
  419. {
  420. BOOL bHandled; // did snap-in handle the notification?
  421. BOOL bExpanding; // TRUE=expanding, FALSE=contracting
  422. HSCOPEITEM hItem; // item that needs to be expanded
  423. } MMC_EXPANDSYNC_STRUCT;
  424. cpp_quote("#endif // MMC_VER >= 0x0110")
  425. cpp_quote("#if (MMC_VER >= 0x0120)")
  426. typedef struct _MMC_VISIBLE_COLUMNS
  427. {
  428. INT nVisibleColumns; // number of items (visible columns) in the array.
  429. INT rgVisibleCols[1]; // indices of visible columns.
  430. } MMC_VISIBLE_COLUMNS;
  431. cpp_quote("#endif // MMC_VER >= 0x0120")
  432. /*
  433. NOTIFICATIONS
  434. =============
  435. Notify(dataobject, event, arg, param);
  436. For all the MMC_NOTIFY_TYPE events,
  437. dataobject
  438. For single select:
  439. dataobject for cookie, can be NULL when dataobject is not required
  440. For multi select:
  441. Console supplied data object. Supports only one format (CCF_MULTI_SELECT_SNAPIN),
  442. which can be used to accquire an IUnknow to the primary snapin.
  443. event = one of the MMCN_NOTIFY_TYPEs
  444. arg and param depend on type, see below.
  445. MMCN_ACTIVATE
  446. Is sent when a window is being activated or deactivated.
  447. arg = TRUE if window is activated, false otherwise.
  448. param = Not used.
  449. return = Not used.
  450. MMCN_ADD_IMAGES
  451. Sent to IComponent to add images for the result pane. The primary snapin
  452. should add images for both folders and leaf items. Extension snapins
  453. should add only folder images.
  454. arg = ptr to result panes IImageList.
  455. param = HSCOPEITEM of selected/deselected item
  456. return = Not used.
  457. MMCN_BTN_CLICK
  458. This message is sent when a user clicks on a button.
  459. arg = When sent to ExtendControlbar it is the data object of currently selected,
  460. when sent to IComponent/IComponentData it is 0.
  461. param = CmdID of the button equal to a value of the MMC_COMMANDS enum type.
  462. return = Not used.
  463. MMCN_CLICK
  464. Not used.
  465. MMCN_DBLCLICK
  466. arg, param = not used.
  467. return = S_FALSE to do the default action, if the default action is one of the standard verbs.
  468. MMCN_EXPAND
  469. arg = TRUE => expand, FALSE => contract
  470. param = parents HSCOPEITEM.
  471. MMCN_MINIMIZED
  472. Is sent when a window is being minimized or maximized.
  473. arg = TRUE if minimized, false otherwise.
  474. MMCN_PROPERTY_CHANGE
  475. lpDataObject = NULL
  476. lParam = user object
  477. MMCN_REMOVE_CHILDREN
  478. Informs the snapin to delete all the cookies it has added below.
  479. arg = HSCOPEITEM of the node whose children needs to be deleted.
  480. param = unused.
  481. return = unused.
  482. MMCN_RENAME
  483. This notification is sent when an item needs to be renamed.
  484. arg = Not used.
  485. param = LPOLESTR for containing new name
  486. return = S_OK to allow rename and S_FALSE to disallow rename.
  487. MMCN_SELECT
  488. If sent to IComponent::Notify:
  489. arg:
  490. BOOL bScope = (BOOL) LOWORD(arg);
  491. BOOL bSelect = (BOOL) HIWORD(arg);
  492. bScope: TRUE if an item the scope pane is selected,
  493. FALSE if an item in the result pane is selected.
  494. bSelect: TRUE if the item is selected,
  495. FALSE if it is de-selected.
  496. param:
  497. Ignored.
  498. If sent to IExtendControlbar::ControlbarNotify:
  499. arg:
  500. BOOL bScope = (BOOL) LOWORD(arg);
  501. BOOL bSelect = (BOOL) HIWORD(arg);
  502. bScope: TRUE if an item the scope pane is selected,
  503. FALSE if an item in the result pane is selected.
  504. bSelect: TRUE if the item is selected,
  505. FALSE if it is de-selected.
  506. param:
  507. LPDATAOBJECT pDataobject = (LPDATAOBJECT)param;
  508. pDataobject data object of item getting selected/de-selected.
  509. MMCN_SHOW
  510. arg = TRUE if selecting, FALSE if deselecting
  511. param = HSCOPEITEM of selected/deselected item
  512. MMCN_VIEW_CHANGE
  513. This message is sent to update all views of a change.
  514. arg = TRUE if Scope Item, FALSE if Result Item
  515. param = ptr to DataObject selected
  516. MMCN_MENU_BTNCLICK
  517. This message is sent when a user clicks on a button.
  518. arg = Data object of currently selected.
  519. param = Structure (LPMENUBUTTONDATA).
  520. MMCN_SNAPINHELP
  521. This message is sent when the user requests help about the snapin.
  522. dataObject = NULL
  523. arg = 0
  524. param = 0
  525. MMCN_CONTEXTHELP
  526. This message is sent when the user requests help about a selected item
  527. arg = 0
  528. param = 0
  529. MMCN_DESELECT_ALL
  530. This message is sent when all items of an owner-data result pane
  531. are deselected.
  532. dataObject = NULL
  533. arg = 0
  534. param = 0
  535. MMCN_COLUMN_CLICK
  536. This message is sent when the user clicks on a result listview column header.
  537. dataObject = NULL
  538. arg = Column number
  539. param = Sort option flags (RSI_xxx)
  540. return = not used.
  541. MMCN_DELETE:
  542. Sent to inform the snapin that the item needs to be deleted. As a result of
  543. the user hitting the 'Delete' key or delete button.
  544. dataobject: dataobject of the selected item(s) provided by the snap-in.
  545. arg, param: unused.
  546. MMCN_CUTORMOVE:
  547. dataobject: NULL.
  548. arg: pointer to a dataobject. See multi-selection below.
  549. param: unused.
  550. MMCN_CANPASTE_OUTOFPROC
  551. dataobject: unused.
  552. arg: unused
  553. param: BOOL *, snapin sets to TRUE iff it handles dataobjects from another MMC process.
  554. Return: S_OK if the dataobject can be handled, S_FALSE otherwise.
  555. MMCN_QUERY_PASTE:
  556. dataobject: dataobject of the selected item provided by the snap-in.
  557. arg: dataobject of the item(s) provided by the source snap-in that needs to be pasted.
  558. param: flags (IsCopy the default action).
  559. Return S_OK if the data can be pasted, S_FALSE otherwise.
  560. MMCN_PASTE:
  561. dataobject & arg: are same as for MMCN_QUERY_PASTE.
  562. param:
  563. NULL for move (as opposed to cut).
  564. For single item paste:
  565. BOOL* pPasted = (BOOL*)param;
  566. Set this to TRUE here if the item was successfully pasted.
  567. For multi-item paste:
  568. LPDATAOBJECT* ppDataObj = (LPDATAOBJECT*)param;
  569. Use this to return a pointer to a dataobject consisting of the
  570. items successfully pasted. (see MMCN_CUTORMOVE below).
  571. MMCN_FILTER_STATE:
  572. This message is sent when the user turns result view filtering on or off.
  573. dataobject = NULL
  574. arg = BOOL, True if filter turned on, Flase if filter turned off
  575. param = unused
  576. MMCN_FILTER_CHANGE:
  577. This message is sent when the filter value for a result view column has been changed.
  578. dataobject= NULL
  579. arg = Filter change code (see MMC_FILTER_CHANGE_CODE enumeration)
  580. param = column number of changed value, if change code is MFCC_VALUE_CHANGE
  581. MMCN_FILTER_CLICK:
  582. This message is sent when the filter button is clicked. The snap-in should display
  583. a UI for selecting the filter options.
  584. dataobject = NULL
  585. arg = Column number
  586. param = Pointer to filter button rect (*RECT)
  587. MMCN_INITOCX:
  588. Sent to a snap-in when its custom OCX is initialized for the first time.
  589. param = The IUnknown to the OCX, the result pane. This is the same IUnknown you would get from IConsole::QueryResultView.
  590. MMCN_PRINT:
  591. Sent to inform the snapin that the item needs to be printed. As a result of
  592. the user selecting the 'Print' button or menu item.
  593. dataobject: dataobject of the selected item(s) provided by the snap-in.
  594. arg, param: unused.
  595. MMCN_PRELOAD:
  596. Sent when parent of snapin to be preloaded is selected.
  597. dataobject: dataobject of snapin root node
  598. arg: HSCOPEITEM of root node
  599. param: unused (0)
  600. MMCN_LISTPAD:
  601. Sent when a TaskPad ListView is being attached or detached.
  602. dataobject: dataobject of selected node
  603. arg: BOOL true when attaching, false when detaching
  604. param: unused (0)
  605. MMCN_RESTORE_VIEW:
  606. Sent when user selects Back/Forward buttons
  607. dataobject: dataobject of selected node
  608. arg: MMC_RESTORE_VIEW struct
  609. param: BOOL *, snapin sets to TRUE iff it handles this notification
  610. MMCN_EXPANDSYNC
  611. This notification is sent when nodes are being expanded during initialization.
  612. The snap-in should handle this synchrnonously, without spawning a
  613. thread to handle the expansion.
  614. arg = unused
  615. param: MMC_EXPANDSYNC_STRUCT*,
  616. snapin sets to MMC_EXPANDSYNC_STRUCT.bHandled to TRUE iff it
  617. handles this notification
  618. MMCN_COLUMNS_CHANGED
  619. This notification is sent to IComponent::Notify when the user hides columns or
  620. makes columns visible in the list view using the columns dialog box accessed
  621. through the view menu.
  622. This notification tells which columns are visible.
  623. arg = unused
  624. param = pointer to MMC_VISIBLE_COLUMNS.
  625. */
  626. /*
  627. * This is lame. We need to make sure that some notifications are available
  628. * only to clients that build with a certain MMC_VER level. Ideally, we'd just
  629. * put the cpp_quote tests around the value definitions in the enumeration.
  630. * MIDL chokes on this, however, so we have this ugly hackery instead. Ugh.
  631. */
  632. cpp_quote("typedef enum _MMC_NOTIFY_TYPE ")
  633. cpp_quote("{ ")
  634. cpp_quote(" MMCN_ACTIVATE = 0x8001, ")
  635. cpp_quote(" MMCN_ADD_IMAGES = 0x8002, ")
  636. cpp_quote(" MMCN_BTN_CLICK = 0x8003, ")
  637. cpp_quote(" MMCN_CLICK = 0x8004, // NOT USED ")
  638. cpp_quote(" MMCN_COLUMN_CLICK = 0x8005, ")
  639. cpp_quote(" MMCN_CONTEXTMENU = 0x8006, // NOT USED ")
  640. cpp_quote(" MMCN_CUTORMOVE = 0x8007, ")
  641. cpp_quote(" MMCN_DBLCLICK = 0x8008, ")
  642. cpp_quote(" MMCN_DELETE = 0x8009, ")
  643. cpp_quote(" MMCN_DESELECT_ALL = 0x800A, ")
  644. cpp_quote(" MMCN_EXPAND = 0x800B, ")
  645. cpp_quote(" MMCN_HELP = 0x800C, // NOT USED ")
  646. cpp_quote(" MMCN_MENU_BTNCLICK = 0x800D, ")
  647. cpp_quote(" MMCN_MINIMIZED = 0x800E, ")
  648. cpp_quote(" MMCN_PASTE = 0x800F, ")
  649. cpp_quote(" MMCN_PROPERTY_CHANGE = 0x8010, ")
  650. cpp_quote(" MMCN_QUERY_PASTE = 0x8011, ")
  651. cpp_quote(" MMCN_REFRESH = 0x8012, ")
  652. cpp_quote(" MMCN_REMOVE_CHILDREN = 0x8013, ")
  653. cpp_quote(" MMCN_RENAME = 0x8014, ")
  654. cpp_quote(" MMCN_SELECT = 0x8015, ")
  655. cpp_quote(" MMCN_SHOW = 0x8016, ")
  656. cpp_quote(" MMCN_VIEW_CHANGE = 0x8017, ")
  657. cpp_quote(" MMCN_SNAPINHELP = 0x8018, ")
  658. cpp_quote(" MMCN_CONTEXTHELP = 0x8019, ")
  659. cpp_quote(" MMCN_INITOCX = 0x801A, ")
  660. cpp_quote("#if (MMC_VER >= 0x0110) ")
  661. cpp_quote(" MMCN_FILTER_CHANGE = 0x801B, ")
  662. cpp_quote(" MMCN_FILTERBTN_CLICK = 0x801C, ")
  663. cpp_quote(" MMCN_RESTORE_VIEW = 0x801D, ")
  664. cpp_quote(" MMCN_PRINT = 0x801E, ")
  665. cpp_quote(" MMCN_PRELOAD = 0x801F, ")
  666. cpp_quote(" MMCN_LISTPAD = 0x8020, ")
  667. cpp_quote(" MMCN_EXPANDSYNC = 0x8021, ")
  668. cpp_quote("#if (MMC_VER >= 0x0120) ")
  669. cpp_quote(" MMCN_COLUMNS_CHANGED = 0x8022, ")
  670. cpp_quote("#if (MMC_VER >= 0x0200) ")
  671. cpp_quote(" MMCN_CANPASTE_OUTOFPROC = 0x8023, ")
  672. cpp_quote("#endif // MMC_VER >= 0x0200 ")
  673. cpp_quote("#endif // MMC_VER >= 0x0120 ")
  674. cpp_quote("#endif // MMC_VER >= 0x0110 ")
  675. cpp_quote("} MMC_NOTIFY_TYPE; ")
  676. cpp_quote("#if 0")
  677. typedef enum _MMC_NOTIFY_TYPE
  678. {
  679. MMCN__dummy_
  680. } MMC_NOTIFY_TYPE;
  681. cpp_quote("#endif")
  682. typedef enum _DATA_OBJECT_TYPES
  683. {
  684. CCT_SCOPE = 0x8000, // Data object while for scope pane context
  685. CCT_RESULT = 0x8001, // Data object while for result pane context
  686. CCT_SNAPIN_MANAGER = 0x8002, // Data object while for snap-in manager context
  687. CCT_UNINITIALIZED = 0xFFFF, // Data object has an invalid type
  688. } DATA_OBJECT_TYPES;
  689. //New window option(s)
  690. const unsigned long MMC_NW_OPTION_NONE = 0x0000;
  691. // No scope pane
  692. const unsigned long MMC_NW_OPTION_NOSCOPEPANE = 0x0001;
  693. // No standard toolbars
  694. const unsigned long MMC_NW_OPTION_NOTOOLBARS = 0x0002;
  695. // Use short window title
  696. const unsigned long MMC_NW_OPTION_SHORTTITLE = 0x0004;
  697. // Snap-in provides window title
  698. const unsigned long MMC_NW_OPTION_CUSTOMTITLE = 0x0008;
  699. // Do not save view to console doc file
  700. const unsigned long MMC_NW_OPTION_NOPERSIST = 0x0010;
  701. ///////////////////////////////////////////////////////////////////////////////
  702. // Common Console clipboard formats
  703. //
  704. // Clipboard format for node type guid
  705. const wchar_t* CCF_NODETYPE = L"CCF_NODETYPE";
  706. // Clipboard format for string version of node type guid
  707. const wchar_t* CCF_SZNODETYPE = L"CCF_SZNODETYPE";
  708. // Clipboard format for name displayed in scope pane
  709. const wchar_t* CCF_DISPLAY_NAME = L"CCF_DISPLAY_NAME";
  710. // Clipboard format for the snapin's class id.
  711. const wchar_t* CCF_SNAPIN_CLASSID = L"CCF_SNAPIN_CLASSID";
  712. // Clipboard format for window title (for window data object)
  713. const wchar_t* CCF_WINDOW_TITLE = L"CCF_WINDOW_TITLE";
  714. // This is the MMC supplied Multi-select data object.
  715. const wchar_t* CCF_MMC_MULTISELECT_DATAOBJECT = L"CCF_MMC_MULTISELECT_DATAOBJECT";
  716. // Clipboard format for the snapins multi selected dataobjects.
  717. // If there are N snapins whose objects are selected in the result
  718. // pane, these N dataobjects will be passed in a GloballAlloced
  719. // memory. The first DWORD contains the number of snapins, this will
  720. // be followed by N ptrs to the DataObjects.
  721. typedef struct _SMMCDataObjects
  722. {
  723. DWORD count;
  724. LPDATAOBJECT lpDataObject[1];
  725. } SMMCDataObjects;
  726. const wchar_t* CCF_MULTI_SELECT_SNAPINS = L"CCF_MULTI_SELECT_SNAPINS";
  727. // Clipboard format for the array of GUIDs which constitutes the object
  728. // types of all the currently selected result items put by the snapin.
  729. typedef struct _SMMCObjectTypes
  730. {
  731. DWORD count;
  732. GUID guid[1];
  733. } SMMCObjectTypes;
  734. const wchar_t* CCF_OBJECT_TYPES_IN_MULTI_SELECT = L"CCF_OBJECT_TYPES_IN_MULTI_SELECT";
  735. cpp_quote("#if (MMC_VER >= 0x0110)")
  736. // Clipboard format for dynamically extending the selected items'
  737. // context menus, toolbars, and/or property pages.
  738. // Same structure as MMCObjectTypes.
  739. typedef SMMCObjectTypes SMMCDynamicExtensions;
  740. const wchar_t* CCF_MMC_DYNAMIC_EXTENSIONS = L"CCF_MMC_DYNAMIC_EXTENSIONS";
  741. // optional Clipboard format for when the snapin wants to be preloaded;
  742. // the data for this format is a BOOL.
  743. const wchar_t* CCF_SNAPIN_PRELOADS = L"CCF_SNAPIN_PRELOADS";
  744. // clipboard format for custom dynamic node IDs
  745. typedef struct _SNodeID
  746. {
  747. DWORD cBytes;
  748. BYTE id[1];
  749. } SNodeID;
  750. cpp_quote("#if (MMC_VER >= 0x0120)")
  751. // updated version
  752. typedef struct _SNodeID2
  753. {
  754. DWORD dwFlags;
  755. DWORD cBytes;
  756. BYTE id[1];
  757. } SNodeID2;
  758. // used by the _SNodeID2 structure
  759. const DWORD MMC_NODEID_SLOW_RETRIEVAL = 0x01;
  760. const wchar_t* CCF_NODEID2 = L"CCF_NODEID2";
  761. cpp_quote("#endif // MMC_VER >= 0x0120")
  762. const wchar_t* CCF_NODEID = L"CCF_NODEID";
  763. cpp_quote("#if (MMC_VER >= 0x0120)")
  764. // Clipboard format to identify a set of columns put by a node
  765. // for persisting column information.
  766. // Two or more nodes can use same column-set.
  767. typedef struct _SColumnSetID
  768. {
  769. DWORD dwFlags;
  770. DWORD cBytes;
  771. BYTE id[1];
  772. } SColumnSetID;
  773. const wchar_t* CCF_COLUMN_SET_ID = L"CCF_COLUMN_SET_ID";
  774. cpp_quote("#endif // MMC_VER >= 0x0120")
  775. cpp_quote("#endif // MMC_VER >= 0x0110")
  776. ///////////////////////////////////////////////////////////////////////////////
  777. // APIs exported in mmc.lib
  778. //
  779. cpp_quote("STDAPI MMCPropertyChangeNotify(LONG_PTR lNotifyHandle, LPARAM param);")
  780. cpp_quote("#if (MMC_VER >= 0x0110)")
  781. cpp_quote("STDAPI MMCPropertyHelp(LPOLESTR pszHelpTopic);")
  782. cpp_quote("#endif // MMC_VER >= 0x0110")
  783. cpp_quote("STDAPI MMCFreeNotifyHandle(LONG_PTR lNotifyHandle);")
  784. cpp_quote("STDAPI MMCPropPageCallback(void* vpsp);")
  785. cpp_quote("EXTERN_C const CLSID CLSID_NodeManager;")
  786. cpp_quote("#if (MMC_VER >= 0x0120)")
  787. cpp_quote("EXTERN_C const CLSID CLSID_MessageView;")
  788. cpp_quote("#endif // MMC_VER >= 0x0120")
  789. ///////////////////////////////////////////////////////////////////////////////
  790. // Special dataobjects
  791. //
  792. cpp_quote("#define DOBJ_NULL (LPDATAOBJECT) 0")
  793. cpp_quote("#define DOBJ_CUSTOMOCX (LPDATAOBJECT) -1")
  794. cpp_quote("#define DOBJ_CUSTOMWEB (LPDATAOBJECT) -2")
  795. cpp_quote("#if (MMC_VER >= 0x0110)")
  796. cpp_quote("#if (MMC_VER >= 0x0120)")
  797. cpp_quote("#define DOBJ_NOCONSOLE (LPDATAOBJECT) -3")
  798. cpp_quote("#endif // MMC_VER >= 0x0120")
  799. cpp_quote("#define SPECIAL_DOBJ_MIN -10")
  800. cpp_quote("#define SPECIAL_DOBJ_MAX 0")
  801. cpp_quote("#endif // MMC_VER >= 0x0110")
  802. ///////////////////////////////////////////////////////////////////////////////
  803. // Macros
  804. //
  805. cpp_quote("#define IS_SPECIAL_DATAOBJECT(d) (((LONG_PTR)(d) >= SPECIAL_DOBJ_MIN) && ((LONG_PTR)(d) <= SPECIAL_DOBJ_MAX))")
  806. cpp_quote("#define IS_SPECIAL_COOKIE(c) (((c) >= SPECIAL_COOKIE_MIN) && ((c) <= SPECIAL_COOKIE_MAX))")
  807. ///////////////////////////////////////////////////////////////////////////////
  808. // Interfaces
  809. //
  810. [
  811. object,
  812. uuid(955AB28A-5218-11D0-A985-00C04FD8D565),
  813. helpstring("IComponentData Interface"),
  814. pointer_default(unique)
  815. ]
  816. interface IComponentData : IUnknown
  817. {
  818. [helpstring("Snap-in entry point. Can QI for IConsole & IConsoleNameSpace")]
  819. HRESULT Initialize([in] LPUNKNOWN pUnknown);
  820. [helpstring("Create a Componet for this ComponetData")]
  821. HRESULT CreateComponent([out] LPCOMPONENT* ppComponent);
  822. [helpstring("User actions")]
  823. HRESULT Notify([in] LPDATAOBJECT lpDataObject, [in] MMC_NOTIFY_TYPE event,
  824. [in] LPARAM arg, [in] LPARAM param);
  825. [helpstring("Release cookies associated with the children of a specific node")]
  826. HRESULT Destroy();
  827. [helpstring("Returns a data object which may be used to retrieve the context information for the specified cookie")]
  828. HRESULT QueryDataObject([in] MMC_COOKIE cookie, [in] DATA_OBJECT_TYPES type,
  829. [out] LPDATAOBJECT* ppDataObject);
  830. [helpstring("Get display info for the name space item")]
  831. HRESULT GetDisplayInfo([in,out] SCOPEDATAITEM* pScopeDataItem);
  832. [helpstring("The snap-in's compare function for two data objects")]
  833. HRESULT CompareObjects([in] LPDATAOBJECT lpDataObjectA, [in] LPDATAOBJECT lpDataObjectB);
  834. };
  835. [
  836. object,
  837. uuid(43136EB2-D36C-11CF-ADBC-00AA00A80033),
  838. helpstring("IComponent Interface"),
  839. pointer_default(unique)
  840. ]
  841. interface IComponent : IUnknown
  842. {
  843. [helpstring("Snap-in entry point")]
  844. HRESULT Initialize([in] LPCONSOLE lpConsole);
  845. [helpstring("User actions")]
  846. HRESULT Notify([in] LPDATAOBJECT lpDataObject, [in] MMC_NOTIFY_TYPE event,
  847. [in] LPARAM arg, [in] LPARAM param);
  848. [helpstring("Release cookies associated with the children of a specific node")]
  849. HRESULT Destroy([in] MMC_COOKIE cookie);
  850. [helpstring("Returns a data object which may be used to retrieve the context information for the specified cookie")]
  851. HRESULT QueryDataObject([in] MMC_COOKIE cookie, [in] DATA_OBJECT_TYPES type,
  852. [out] LPDATAOBJECT* ppDataObject);
  853. [helpstring("Returns the result view type for the specified cookie")]
  854. HRESULT GetResultViewType([in] MMC_COOKIE cookie, [out] LPOLESTR* ppViewType,
  855. [out] long* pViewOptions);
  856. [helpstring("Get display info for the result item")]
  857. HRESULT GetDisplayInfo([in,out] RESULTDATAITEM* pResultDataItem);
  858. [helpstring("The snap-in's compare function for two data objects")]
  859. HRESULT CompareObjects([in] LPDATAOBJECT lpDataObjectA, [in] LPDATAOBJECT lpDataObjectB);
  860. };
  861. [
  862. object,
  863. uuid(E8315A52-7A1A-11D0-A2D2-00C04FD909DD),
  864. helpstring("Compare interface for sorting result items"),
  865. pointer_default(unique)
  866. ]
  867. interface IResultDataCompare : IUnknown
  868. {
  869. [helpstring("Compare two cookies")]
  870. HRESULT Compare([in] LPARAM lUserParam,
  871. [in] MMC_COOKIE cookieA, [in] MMC_COOKIE cookieB, [in, out] int* pnResult);
  872. }
  873. [
  874. object,
  875. uuid(9CB396D8-EA83-11d0-AEF1-00C04FB6DD2C),
  876. helpstring("Interface for owner data result pane list"),
  877. pointer_default(unique)
  878. ]
  879. interface IResultOwnerData : IUnknown
  880. {
  881. [helpstring("Find result item that matches string")]
  882. HRESULT FindItem([in] LPRESULTFINDINFO pFindInfo, [out] int* pnFoundIndex);
  883. [helpstring("Hint to cache result item data")]
  884. HRESULT CacheHint ([in] int nStartIndex, [in] int nEndIndex);
  885. [helpstring("Sort result items")]
  886. HRESULT SortItems([in] int nColumn, [in] DWORD dwSortOptions, [in] LPARAM lUserParam);
  887. }
  888. [
  889. object,
  890. uuid(43136EB1-D36C-11CF-ADBC-00AA00A80033),
  891. helpstring("IConsole Interface"),
  892. pointer_default(unique)
  893. ]
  894. interface IConsole : IUnknown
  895. {
  896. [helpstring("Sets IConsoles header interface")]
  897. HRESULT SetHeader([in] LPHEADERCTRL pHeader);
  898. [helpstring("Sets IConsoles toolbar interface")]
  899. HRESULT SetToolbar([in] LPTOOLBAR pToolbar);
  900. [helpstring("Queries IConsoles user provided IUnknown")]
  901. HRESULT QueryResultView([out] LPUNKNOWN* pUnknown);
  902. [helpstring("Queries the IConsole provided image list for the scope pane.")]
  903. HRESULT QueryScopeImageList([out] LPIMAGELIST* ppImageList);
  904. [helpstring("Queries the IConsole provided image list for the result pane.")]
  905. HRESULT QueryResultImageList([out] LPIMAGELIST* ppImageList);
  906. [helpstring("Generates a notification to update view(s) because of content change")]
  907. HRESULT UpdateAllViews([in] LPDATAOBJECT lpDataObject,
  908. [in] LPARAM data,
  909. [in] LONG_PTR hint);
  910. [helpstring("Displays a message box")]
  911. HRESULT MessageBox([in] LPCWSTR lpszText, [in] LPCWSTR lpszTitle,
  912. [in] UINT fuStyle, [out] int* piRetval);
  913. [helpstring("Query for the IConsoleVerb.")]
  914. HRESULT QueryConsoleVerb([out] LPCONSOLEVERB * ppConsoleVerb);
  915. [helpstring("Selects the given scope item.")]
  916. HRESULT SelectScopeItem([in] HSCOPEITEM hScopeItem);
  917. [helpstring("Returns handle to the main frame window.")]
  918. HRESULT GetMainWindow([out] HWND* phwnd);
  919. [helpstring("Create a new window rooted at the scope item specified by hScopeItem.")]
  920. HRESULT NewWindow([in] HSCOPEITEM hScopeItem, [in] unsigned long lOptions);
  921. };
  922. [
  923. object,
  924. uuid(43136EB3-D36C-11CF-ADBC-00AA00A80033),
  925. helpstring("INodeInit Interface"),
  926. pointer_default(unique)
  927. ]
  928. interface IHeaderCtrl : IUnknown
  929. {
  930. const int AUTO_WIDTH = -1; // Column width is determined by the string length + padding
  931. cpp_quote("#if (MMC_VER >= 0x0120)")
  932. const int HIDE_COLUMN = -4; // Column will be hidden
  933. cpp_quote("#endif // MMC_VER >= 0x0120")
  934. [helpstring("Add a column to a Default Result view")]
  935. HRESULT InsertColumn([in] int nCol, [in,] LPCWSTR title, [in] int nFormat, [in] int nWidth);
  936. [helpstring("Remove a column to a Default Result view")]
  937. HRESULT DeleteColumn([in] int nCol);
  938. [helpstring("Set a columns text")]
  939. HRESULT SetColumnText([in] int nCol, [in] LPCWSTR title);
  940. [helpstring("Gets a columns text")]
  941. HRESULT GetColumnText([in] int nCol, [out] LPOLESTR* pText);
  942. [helpstring("Set a columns width")]
  943. HRESULT SetColumnWidth([in] int nCol, [in] int nWidth);
  944. [helpstring("Gets a columns width")]
  945. HRESULT GetColumnWidth([in] int nCol, [out] int* pWidth);
  946. };
  947. enum
  948. {
  949. ///////////////////////////////////////////////////////////////////////////////
  950. // The following bits in insertion point / submenu IDs are handled specially:
  951. //
  952. // CCM_INSERTIONPOINTID_MASK_SPECIAL:
  953. // Insertion points and submenus whose IDs contain any bit in
  954. // CCM_INSERTIONPOINTID_MASK_SPECIAL have special behavior. Snap-Ins may use
  955. // the other bits as they see fit.
  956. // CCM_INSERTIONPOINTID_MASK_SHARED:
  957. // Insertion points and submenus whose IDs contain CCM_INSERTIONPOINTID_MASK_SHARED
  958. // are shared between the creator of the context menu, the primary extension and
  959. // the third-party extension. Any of these entities adding items to a shared
  960. // insertion point or submenu, add them to the same insertion point or submenu.
  961. // Only IContextMenuProvider may create insertion points or submenus with this bit
  962. // set, unless CCM_INSERTIONPOINTID_MASK_CREATE_PRIMARY is also set, in which case
  963. // only the primary extension may create them.
  964. // CCM_INSERTIONPOINT_CREATE_PRIMARY:
  965. // Only the system may add insertion points or submenus for which CCM_INSERTIONPOINT_SHARED
  966. // is set and this bit is not set. Only the primary extension may add insertion points
  967. // or submenus for which both bits are set. This prevents insertion point ID conflicts
  968. // between insertion points and submenus created by IContextMenuProvider and those
  969. // created by the primary extension.
  970. // CCM_INSERTIONPOINTID_MASK_ADD_PRIMARY:
  971. // If CCM_INSERTIONPOINT_SHARED is set and this bit is not set, then
  972. // the primary extension may not add to this insertion point or submenu.
  973. // CCM_INSERTIONPOINTID_MASK_ADD_3RDPARTY:
  974. // If CCM_INSERTIONPOINT_SHARED is set and this bit is not set, then
  975. // the third-party extensions may not add to this insertion point or submenu.
  976. // CCM_INSERTIONPOINTID_MASK_RESERVED:
  977. // Insertion points and submenus may not be added with any of these bits set.
  978. // CCM_INSERTIONPOINTID_MASK_FLAGINDEX:
  979. // This mask extracts the the index field from system insertion point IDs.
  980. // The index gives the bit position of the associated insertion allowed flag.
  981. CCM_INSERTIONPOINTID_MASK_SPECIAL = 0xFFFF0000,
  982. CCM_INSERTIONPOINTID_MASK_SHARED = 0x80000000,
  983. CCM_INSERTIONPOINTID_MASK_CREATE_PRIMARY = 0x40000000,
  984. CCM_INSERTIONPOINTID_MASK_ADD_PRIMARY = 0x20000000,
  985. CCM_INSERTIONPOINTID_MASK_ADD_3RDPARTY = 0x10000000,
  986. CCM_INSERTIONPOINTID_MASK_RESERVED = 0x0FFF0000,
  987. CCM_INSERTIONPOINTID_MASK_FLAGINDEX = 0x0000001F,
  988. ///////////////////////////////////////////////////////////////////////////////
  989. // Use these InsertionPointIDs to add items at the predefined insertion points:
  990. //
  991. // 0
  992. // This is interpreted the same as CCM_INSERTIONPOINTID_ROOT_MENU (see below).
  993. // CCM_INSERTIONPOINTID_PRIMARY_TOP:
  994. // The primary extension may use this insertion point to add items to the top of
  995. // the main context menu.
  996. // CCM_INSERTIONPOINTID_PRIMARY_NEW:
  997. // The primary extension may use this insertion point to add items to the top of
  998. // the Create New submenu.
  999. // CCM_INSERTIONPOINTID_PRIMARY_TASK:
  1000. // The primary extension may use this insertion point to add items to the top of
  1001. // the Task submenu.
  1002. // CCM_INSERTIONPOINTID_3RDPARTY_NEW:
  1003. // Third-party extensions may use this insertion point to add items to the bottom of
  1004. // the Create New submenu.
  1005. // CCM_INSERTIONPOINTID_3RDPARTY_TASK:
  1006. // Third-party extensions may use this insertion point to add items to the bottom of
  1007. // the Task submenu.
  1008. // CCM_INSERTIONPOINTID_ROOT_MENU:
  1009. // IContextMenuProvider may use this insertion point to add items to the root menu.
  1010. // Neither primary extensions nor third-party extension may add items to the root
  1011. // menu except through insertion points added by IContextMenuProvider.
  1012. //
  1013. CCM_INSERTIONPOINTID_PRIMARY_TOP = 0xA0000000, // SHARED and ADD_PRIMARY
  1014. CCM_INSERTIONPOINTID_PRIMARY_NEW = 0xA0000001, // SHARED and ADD_PRIMARY
  1015. CCM_INSERTIONPOINTID_PRIMARY_TASK = 0xA0000002, // SHARED and ADD_PRIMARY
  1016. CCM_INSERTIONPOINTID_PRIMARY_VIEW = 0xA0000003, // SHARED and ADD_PRIMARY
  1017. CCM_INSERTIONPOINTID_3RDPARTY_NEW = 0x90000001, // SHARED and ADD_3RDPARTY
  1018. CCM_INSERTIONPOINTID_3RDPARTY_TASK = 0x90000002, // SHARED and ADD_3RDPARTY
  1019. CCM_INSERTIONPOINTID_ROOT_MENU = 0x80000000 // SHARED
  1020. };
  1021. //
  1022. // Macro to derive an insertion allowed flag from an system insertion point ID
  1023. //
  1024. #define INSERTALLOWED_FLAG(insertionID) \
  1025. (1L << (insertionID & CCM_INSERTIONPOINTID_MASK_FLAGINDEX))
  1026. enum
  1027. {
  1028. /////////////////////////////////////////////////////////////////////////////////////
  1029. // These flags give permission to insert menu items at the CCM_INSERTIONPOINTID_xxx
  1030. // insertion points define above. The bit position of each flag is derived from the
  1031. // index portion of the corresponding insertion point ID. They are passed to the
  1032. // snap-in's AddMenuItems method.
  1033. CCM_INSERTIONALLOWED_TOP = INSERTALLOWED_FLAG(CCM_INSERTIONPOINTID_PRIMARY_TOP),
  1034. CCM_INSERTIONALLOWED_NEW = INSERTALLOWED_FLAG(CCM_INSERTIONPOINTID_PRIMARY_NEW),
  1035. CCM_INSERTIONALLOWED_TASK = INSERTALLOWED_FLAG(CCM_INSERTIONPOINTID_PRIMARY_TASK),
  1036. CCM_INSERTIONALLOWED_VIEW = INSERTALLOWED_FLAG(CCM_INSERTIONPOINTID_PRIMARY_VIEW)
  1037. };
  1038. enum
  1039. {
  1040. ///////////////////////////////////////////////////////////////////////////////
  1041. // The following bits in menu command IDs are handled specially:
  1042. //
  1043. // CCM_COMMANDID_MASK_RESERVED:
  1044. // Items other than insertion points and submenus may not be added with any of
  1045. // these bits set.
  1046. //
  1047. CCM_COMMANDID_MASK_RESERVED = 0xFFFF0000
  1048. };
  1049. enum
  1050. {
  1051. ///////////////////////////////////////////////////////////////////////////////
  1052. // The following flags may be passed via AddMenuItem parameter fSpecialFlags:
  1053. //
  1054. // CCM_SPECIAL_SEPARATOR
  1055. // Ignore all other parameters except lInsertionPointID. Add a separator to the
  1056. // end of the menu or the specified insertion point, except that
  1057. // CCM_SPECIAL_SEPARATOR will never add a separator as the first or last item
  1058. // in a menu/submenu, and if two or more consecutive CCM_SPECIAL_SEPARATORs are added,
  1059. // only one appears in the menu. Only IContextMenuProvider is permitted to add
  1060. // separators, either special or otherwise, to menus created by IContextMenuProvider.
  1061. //
  1062. CCM_SPECIAL_SEPARATOR = 0x0001,
  1063. //
  1064. // CCM_SPECIAL_SUBMENU
  1065. // If this submenu is empty, then it will be grayed and disabled.
  1066. // This is only valid for MF_POPUP items.
  1067. //
  1068. CCM_SPECIAL_SUBMENU = 0x0002,
  1069. //
  1070. // CCM_SPECIAL_DEFAULT_ITEM
  1071. // This should be the default menu item. If more than one menu item specifies this flag,
  1072. // the last one in each submenu takes precedence.
  1073. //
  1074. CCM_SPECIAL_DEFAULT_ITEM = 0x0004,
  1075. //
  1076. // CCM_SPECIAL_INSERTION_POINT
  1077. // Ignore all other parameters except lCommandID and lInsertionPointID. This creates
  1078. // a new "insertion point" at the end of the insertion point or submenu identified by
  1079. // lInsertionPointID (0 is the end of the main menu). Subsequent calls may use
  1080. // the lCommandID from this call as their lInsertionPointID, and insert their own
  1081. // menu items, submenus or insertion points at this point in this menu.
  1082. //
  1083. CCM_SPECIAL_INSERTION_POINT = 0x0008,
  1084. //
  1085. // CCM_SPECIAL_TESTONLY
  1086. // Perform the normal validation of the menu item parameters and return the appropriate
  1087. // result code, but do not actually add the menu item.
  1088. //
  1089. CCM_SPECIAL_TESTONLY = 0x0010
  1090. };
  1091. [
  1092. object,
  1093. uuid(43136EB7-D36C-11CF-ADBC-00AA00A80033),
  1094. helpstring("IContextMenuCallback Interface"),
  1095. pointer_default(unique)
  1096. ]
  1097. interface IContextMenuCallback : IUnknown
  1098. {
  1099. // returns S_OK if the item was added
  1100. // returns E_INVALIDARG if given a NULL pointer
  1101. // returns E_INVALIDARG if an item already exists with this lCommandID
  1102. // returns E_INVALIDARG if insertion point ID could not be found
  1103. // returns E_INVALIDARG if command ID or insertion point ID is invalid
  1104. // returns E_INVALIDARG if fFlags contains MF_OWNERDRAW or MF_BITMAP
  1105. // returns E_INVALIDARG if an extension attempts to add an item where
  1106. // fFlags contains MF_SEPARATOR or fSpecialFlags contains CCM_SPECIAL_SEPARATOR
  1107. // except in submenus created by extensions
  1108. // otherwise an unexpected error occurred
  1109. [helpstring("Adds one item to context menu")]
  1110. HRESULT AddItem([in] CONTEXTMENUITEM* pItem);
  1111. };
  1112. [
  1113. object,
  1114. uuid(43136EB6-D36C-11CF-ADBC-00AA00A80033),
  1115. object,
  1116. helpstring("IContextMenuProvider Interface"),
  1117. pointer_default(unique)
  1118. ]
  1119. //
  1120. // Note that this derives from IContextMenuCallback
  1121. //
  1122. interface IContextMenuProvider : IContextMenuCallback
  1123. {
  1124. // Methods
  1125. // returns S_OK unless an unexpected error occurs
  1126. [helpstring("Clear context menu")]
  1127. HRESULT EmptyMenuList();
  1128. // returns S_OK if successful
  1129. // returns E_INVALIDARG on NULL parameter
  1130. // passes through return code from IExtendContextMenu::AddMenuItems
  1131. // or from CoCreateInstance
  1132. // otherwise an unexpected error occurred
  1133. [helpstring("Allow the primary extension to add to bottom of context menu")]
  1134. HRESULT AddPrimaryExtensionItems([in] LPUNKNOWN piExtension, [in] LPDATAOBJECT piDataObject);
  1135. // returns S_OK if successful
  1136. // returns E_INVALIDARG on NULL parameter
  1137. // returns S_FALSE if context menu has already been extended
  1138. // passes through return code from IExtendContextMenu::AddMenuItems
  1139. // or from CLSIDToString or CoCreateInstance
  1140. // otherwise an unexpected error occurred
  1141. [helpstring("Allow third-party extensions to add to bottom of context menu")]
  1142. HRESULT AddThirdPartyExtensionItems([in] LPDATAOBJECT piDataObject);
  1143. // returns S_OK unless an unexpected error occurs
  1144. [helpstring("Display context menu")]
  1145. HRESULT ShowContextMenu([in] HWND hwndParent, [in] long xPos, [in] long yPos, [out,retval] long* plSelected);
  1146. };
  1147. [
  1148. object,
  1149. uuid(4F3B7A4F-CFAC-11CF-B8E3-00C04FD8D5B0),
  1150. helpstring("IExtendContextMenu Interface"),
  1151. pointer_default(unique)
  1152. ]
  1153. interface IExtendContextMenu : IUnknown
  1154. {
  1155. [helpstring("Extension may add context menu items via callback interface")]
  1156. HRESULT AddMenuItems([in] LPDATAOBJECT piDataObject,
  1157. [in] LPCONTEXTMENUCALLBACK piCallback,
  1158. [in,out] long *pInsertionAllowed);
  1159. [helpstring("Extension context menu item was selected")]
  1160. HRESULT Command([in] long lCommandID, [in] LPDATAOBJECT piDataObject);
  1161. };
  1162. cpp_quote("#if (MMC_VER >= 0x0120)")
  1163. // specify change large or small icon only in ImageListSetIcon
  1164. cpp_quote("#define ILSIF_LEAVE_LARGE_ICON 0x40000000")
  1165. cpp_quote("#define ILSIF_LEAVE_SMALL_ICON 0x20000000")
  1166. cpp_quote("#define ILSIF_LEAVE_MASK (ILSIF_LEAVE_LARGE_ICON | ILSIF_LEAVE_SMALL_ICON)")
  1167. cpp_quote("#define ILSI_LARGE_ICON(nLoc) (nLoc | ILSIF_LEAVE_SMALL_ICON)")
  1168. cpp_quote("#define ILSI_SMALL_ICON(nLoc) (nLoc | ILSIF_LEAVE_LARGE_ICON)")
  1169. cpp_quote("#endif // MMC_VER >= 0x0120")
  1170. [
  1171. object,
  1172. uuid(43136EB8-D36C-11CF-ADBC-00AA00A80033),
  1173. helpstring("IImageList Interface"),
  1174. pointer_default(unique)
  1175. ]
  1176. interface IImageList : IUnknown
  1177. {
  1178. [helpstring("Sets an Icon in the image list, creates it if it is not there.")]
  1179. HRESULT ImageListSetIcon([in] LONG_PTR* pIcon, [in] long nLoc);
  1180. [helpstring("Sets a strip in the image list, starting at nLoc using a pair of bitmaps.")]
  1181. HRESULT ImageListSetStrip([in] LONG_PTR* pBMapSm,
  1182. [in] LONG_PTR* pBMapLg,[in] long nStartLoc, [in] COLORREF cMask);
  1183. };
  1184. [
  1185. object,
  1186. uuid(31DA5FA0-E0EB-11cf-9F21-00AA003CA9F6),
  1187. helpstring("IResultData Interface"),
  1188. pointer_default(unique)
  1189. ]
  1190. interface IResultData : IUnknown
  1191. {
  1192. [helpstring("Allows the snap-in to insert a single item.")]
  1193. HRESULT InsertItem([in,out] LPRESULTDATAITEM item);
  1194. [helpstring("Allows the snap-in to delete a single item.")]
  1195. HRESULT DeleteItem([in] HRESULTITEM itemID, [in] int nCol);
  1196. [helpstring("Allows the snap-in to find an item/subitem based on its user inserted lParam.")]
  1197. HRESULT FindItemByLParam([in] LPARAM lParam, [out] HRESULTITEM *pItemID);
  1198. [helpstring("Allows the snap-in to delete all the items.")]
  1199. HRESULT DeleteAllRsltItems();
  1200. [helpstring("Allows the snap-in to set a single item.")]
  1201. HRESULT SetItem([in] LPRESULTDATAITEM item);
  1202. [helpstring("Allows the snap-in to get a single item.")]
  1203. HRESULT GetItem([in,out] LPRESULTDATAITEM item);
  1204. [helpstring("Returns the lParam of the first item, which matches the given state.")]
  1205. HRESULT GetNextItem([in,out] LPRESULTDATAITEM item);
  1206. [helpstring("Allows the snap-in to modify the state of an item.")]
  1207. HRESULT ModifyItemState([in] int nIndex, [in] HRESULTITEM itemID,
  1208. [in] UINT uAdd, [in] UINT uRemove);
  1209. [helpstring("Allows the snap-in to set the result view style.")]
  1210. HRESULT ModifyViewStyle([in] MMC_RESULT_VIEW_STYLE add,
  1211. [in] MMC_RESULT_VIEW_STYLE remove);
  1212. [helpstring("Allows the snap-in to set the result view mode.")]
  1213. HRESULT SetViewMode([in] long lViewMode);
  1214. [helpstring("Allows the snap-in to get the result view mode.")]
  1215. HRESULT GetViewMode([out] long* lViewMode);
  1216. [helpstring("Allows the snap-in to update a single item.")]
  1217. HRESULT UpdateItem([in] HRESULTITEM itemID);
  1218. [helpstring("Sort all items in result pane")]
  1219. HRESULT Sort([in] int nColumn, [in] DWORD dwSortOptions, [in] LPARAM lUserParam);
  1220. [helpstring("Set the description bar text for the result view")]
  1221. HRESULT SetDescBarText([in] LPOLESTR DescText);
  1222. [helpstring("Set number of items in result pane list")]
  1223. HRESULT SetItemCount([in] int nItemCount, [in] DWORD dwOptions);
  1224. };
  1225. [
  1226. object,
  1227. uuid(BEDEB620-F24D-11cf-8AFC-00AA003CA9F6),
  1228. helpstring("IConsoleNameSpace Interface"),
  1229. pointer_default(unique)
  1230. ]
  1231. interface IConsoleNameSpace : IUnknown
  1232. {
  1233. import "oaidl.idl";
  1234. [helpstring("Allows the snap-in to insert a single item into the scope view.")]
  1235. HRESULT InsertItem([in,out] LPSCOPEDATAITEM item);
  1236. [helpstring("Allows the snap-in to delete a single item from the scope view.")]
  1237. HRESULT DeleteItem([in] HSCOPEITEM hItem, [in] long fDeleteThis);
  1238. [helpstring("Allows the snap-in to set a single scope view item.")]
  1239. HRESULT SetItem([in] LPSCOPEDATAITEM item);
  1240. [helpstring("Allows the snap-in to get a single scope view item.")]
  1241. HRESULT GetItem([in,out] LPSCOPEDATAITEM item);
  1242. [helpstring("The handle of the child item if successful, otherwise NULL.")]
  1243. HRESULT GetChildItem([in] HSCOPEITEM item, [out] HSCOPEITEM* pItemChild,
  1244. [out] MMC_COOKIE* pCookie);
  1245. [helpstring("The handle of the next item if successful, otherwise NULL.")]
  1246. HRESULT GetNextItem([in] HSCOPEITEM item, [out] HSCOPEITEM* pItemNext,
  1247. [out] MMC_COOKIE* pCookie);
  1248. [helpstring("The handle of the parent item if successful, otherwise NULL.")]
  1249. HRESULT GetParentItem([in] HSCOPEITEM item, [out] HSCOPEITEM* pItemParent,
  1250. [out] MMC_COOKIE* pCookie);
  1251. };
  1252. [
  1253. object,
  1254. uuid(255F18CC-65DB-11D1-A7DC-00C04FD8D565),
  1255. helpstring("IConsoleNameSpace2 Interface"),
  1256. pointer_default(unique)
  1257. ]
  1258. interface IConsoleNameSpace2 : IConsoleNameSpace
  1259. {
  1260. [helpstring("Allows the snap-in to expand an item in the console namespace.")]
  1261. HRESULT Expand([in] HSCOPEITEM hItem);
  1262. [helpstring("Add a dynamic extension to a selected node")]
  1263. HRESULT AddExtension([in] HSCOPEITEM hItem, [in] LPCLSID lpClsid);
  1264. };
  1265. struct _PSP;
  1266. typedef struct _PSP * HPROPSHEETPAGE;
  1267. [
  1268. local,
  1269. object,
  1270. uuid(85DE64DD-EF21-11cf-A285-00C04FD8DBE6),
  1271. helpstring("IPropertySheetCallback Interface"),
  1272. pointer_default(unique)
  1273. ]
  1274. interface IPropertySheetCallback : IUnknown
  1275. {
  1276. [helpstring("Snap-in uses this to add a page to a property sheet")]
  1277. HRESULT AddPage([in] HPROPSHEETPAGE hPage);
  1278. [helpstring("Snap-in uses this to remove a page from a property sheet")]
  1279. HRESULT RemovePage([in] HPROPSHEETPAGE hPage);
  1280. };
  1281. [
  1282. object,
  1283. uuid(85DE64DE-EF21-11cf-A285-00C04FD8DBE6),
  1284. helpstring("IPropertySheetProvider Interface"),
  1285. pointer_default(unique)
  1286. ]
  1287. interface IPropertySheetProvider : IUnknown
  1288. {
  1289. [helpstring("Creates a property sheet frame")]
  1290. HRESULT CreatePropertySheet([in] LPCWSTR title, [in] boolean type,
  1291. [in] MMC_COOKIE cookie, [in] LPDATAOBJECT pIDataObjectm,
  1292. [in] DWORD dwOptions);
  1293. [helpstring("Determine if the property sheet exist")]
  1294. HRESULT FindPropertySheet([in] MMC_COOKIE cookie, [in] LPCOMPONENT lpComponent, [in] LPDATAOBJECT lpDataObject);
  1295. [helpstring("Collects the pages from the primary snap-in")]
  1296. HRESULT AddPrimaryPages(LPUNKNOWN lpUnknown, BOOL bCreateHandle, HWND hNotifyWindow, BOOL bScopePane);
  1297. [helpstring("Collects the pages from the extension snap-in(s)")]
  1298. HRESULT AddExtensionPages();
  1299. [helpstring("Shows a property sheet frame parented to the HWND passed in")]
  1300. HRESULT Show([in] LONG_PTR window, [in] int page);
  1301. };
  1302. [
  1303. object,
  1304. uuid(85DE64DC-EF21-11cf-A285-00C04FD8DBE6),
  1305. helpstring("IExtendPropertySheet Interface"),
  1306. pointer_default(unique)
  1307. ]
  1308. interface IExtendPropertySheet : IUnknown
  1309. {
  1310. [helpstring("Interface implemented by the snap-in to add pages to a sheet")]
  1311. // handle - This handle must be saved in the property page object
  1312. // to notify the parent of changes in property using API
  1313. // MMCPropertyChangeNotify. The API MMCFreeNotifyHandle
  1314. // should be called just before the property page is
  1315. // destroyed to delete the handle.
  1316. HRESULT CreatePropertyPages([in] LPPROPERTYSHEETCALLBACK lpProvider,
  1317. [in] LONG_PTR handle,
  1318. [in] LPDATAOBJECT lpIDataObject);
  1319. [helpstring("Interface implemented by the snap-in to determine if this object needs pages")]
  1320. HRESULT QueryPagesFor([in] LPDATAOBJECT lpDataObject);
  1321. };
  1322. [
  1323. object,
  1324. uuid(69FB811E-6C1C-11D0-A2CB-00C04FD909DD),
  1325. helpstring("Control bar to hold toolbar and other controls"),
  1326. pointer_default(unique)
  1327. ]
  1328. interface IControlbar : IUnknown
  1329. {
  1330. [helpstring("Create and return the control requested")]
  1331. HRESULT Create([in] MMC_CONTROL_TYPE nType,
  1332. [in] LPEXTENDCONTROLBAR pExtendControlbar,
  1333. [out] LPUNKNOWN* ppUnknown);
  1334. [helpstring("Associated the control to the control bar")]
  1335. HRESULT Attach([in] MMC_CONTROL_TYPE nType, [in] LPUNKNOWN lpUnknown);
  1336. [helpstring("Break the association between the control and the control bar")]
  1337. HRESULT Detach([in] LPUNKNOWN lpUnknown);
  1338. };
  1339. [
  1340. object,
  1341. uuid(49506520-6F40-11D0-A98B-00C04FD8D565),
  1342. helpstring("IExtendControlbar Interface"),
  1343. pointer_default(unique)
  1344. ]
  1345. interface IExtendControlbar : IUnknown
  1346. {
  1347. [helpstring("Extension may add toolbars via callback interface")]
  1348. HRESULT SetControlbar([in] LPCONTROLBAR pControlbar);
  1349. [helpstring("User actions")]
  1350. HRESULT ControlbarNotify([in] MMC_NOTIFY_TYPE event,
  1351. [in] LPARAM arg, [in] LPARAM param);
  1352. };
  1353. [
  1354. object,
  1355. uuid(43136EB9-D36C-11CF-ADBC-00AA00A80033),
  1356. pointer_default(unique)
  1357. ]
  1358. interface IToolbar : IUnknown
  1359. {
  1360. [helpstring("Add and image to the toolbar")]
  1361. HRESULT AddBitmap([in] int nImages, [in] HBITMAP hbmp, [in] int cxSize, [in] int cySize, [in] COLORREF crMask );
  1362. [helpstring("Add an array of buttons to the toolbar")]
  1363. HRESULT AddButtons([in] int nButtons, [in] LPMMCBUTTON lpButtons);
  1364. [helpstring("Add a single button to the toolbar at position nIndex")]
  1365. HRESULT InsertButton([in] int nIndex, [in] LPMMCBUTTON lpButton);
  1366. [helpstring("Remove a button at the index")]
  1367. HRESULT DeleteButton([in] int nIndex);
  1368. [helpstring("Get an attribute of a button")]
  1369. HRESULT GetButtonState([in] int idCommand, [in] MMC_BUTTON_STATE nState, [out] BOOL* pState);
  1370. [helpstring("Set an attribute of a button")]
  1371. HRESULT SetButtonState([in] int idCommand, [in] MMC_BUTTON_STATE nState, [in] BOOL bState);
  1372. };
  1373. [
  1374. object,
  1375. uuid(E49F7A60-74AF-11D0-A286-00C04FD8FE93),
  1376. pointer_default(unique)
  1377. ]
  1378. interface IConsoleVerb : IUnknown
  1379. {
  1380. [helpstring("Get verb state")]
  1381. HRESULT GetVerbState([in] MMC_CONSOLE_VERB eCmdID, [in] MMC_BUTTON_STATE nState, [out] BOOL* pState);
  1382. [helpstring("Set verb state")]
  1383. HRESULT SetVerbState([in] MMC_CONSOLE_VERB eCmdID, [in] MMC_BUTTON_STATE nState, [in] BOOL bState);
  1384. [helpstring("Set default verb")]
  1385. HRESULT SetDefaultVerb([in] MMC_CONSOLE_VERB eCmdID);
  1386. [helpstring("Get default verb")]
  1387. HRESULT GetDefaultVerb([out] MMC_CONSOLE_VERB* peCmdID);
  1388. };
  1389. [
  1390. object,
  1391. uuid(1245208C-A151-11D0-A7D7-00C04FD909DD),
  1392. pointer_default(unique)
  1393. ]
  1394. interface ISnapinAbout : IUnknown
  1395. {
  1396. [helpstring("Text for the snap-in description box")]
  1397. HRESULT GetSnapinDescription([out] LPOLESTR* lpDescription);
  1398. [helpstring("Provider name")]
  1399. HRESULT GetProvider([out] LPOLESTR* lpName);
  1400. [helpstring("Version number for the snap-in")]
  1401. HRESULT GetSnapinVersion([out] LPOLESTR* lpVersion);
  1402. [helpstring("Main icon for about box")]
  1403. HRESULT GetSnapinImage([out] HICON* hAppIcon);
  1404. [helpstring("Static folder images for scope and result panes")]
  1405. HRESULT GetStaticFolderImage([out] HBITMAP* hSmallImage,
  1406. [out] HBITMAP* hSmallImageOpen,
  1407. [out] HBITMAP* hLargeImage,
  1408. [out] COLORREF* cMask);
  1409. };
  1410. [
  1411. object,
  1412. uuid(951ED750-D080-11d0-B197-000000000000),
  1413. pointer_default(unique)
  1414. ]
  1415. interface IMenuButton : IUnknown
  1416. {
  1417. [helpstring("Adds a button")]
  1418. HRESULT AddButton([in] int idCommand,[in] LPOLESTR lpButtonText,
  1419. [in] LPOLESTR lpTooltipText);
  1420. [helpstring("Set an attributes of a button")]
  1421. HRESULT SetButton([in] int idCommand,[in] LPOLESTR lpButtonText,
  1422. [in] LPOLESTR lpTooltipText);
  1423. [helpstring("Set the state of a button")]
  1424. HRESULT SetButtonState([in] int idCommand,
  1425. [in] MMC_BUTTON_STATE nState,
  1426. [in] BOOL bState);
  1427. };
  1428. [
  1429. object,
  1430. uuid(A6B15ACE-DF59-11D0-A7DD-00C04FD909DD),
  1431. pointer_default(unique)
  1432. ]
  1433. interface ISnapinHelp : IUnknown
  1434. {
  1435. [helpstring("Get the compiled help file (.chm) from a snap-in to merge")]
  1436. HRESULT GetHelpTopic([out] LPOLESTR* lpCompiledHelpFile);
  1437. };
  1438. ///////////////////////////////////////////////////////////////////////////////
  1439. ///////////////////////////////////////////////////////////////////////////////
  1440. ///////////////////////////////////////////////////////////////////////////////
  1441. ///////////////////////////////////////////////////////////////////////////////
  1442. ////
  1443. //// MMC 1.1 changes
  1444. ////
  1445. cpp_quote("#if (MMC_VER >= 0x0110)")
  1446. [
  1447. object,
  1448. uuid(B7A87232-4A51-11D1-A7EA-00C04FD909DD),
  1449. helpstring("IExtendPropertySheet2 Interface, adds support for Wizard 97 specification"),
  1450. pointer_default(unique)
  1451. ]
  1452. interface IExtendPropertySheet2 : IExtendPropertySheet
  1453. {
  1454. [helpstring("Interface implemented by the snap-in, to get the watermark and text for Wizard 97 style")]
  1455. HRESULT GetWatermarks([in] LPDATAOBJECT lpIDataObject,
  1456. [out] HBITMAP* lphWatermark,
  1457. [out] HBITMAP* lphHeader,
  1458. [out] HPALETTE* lphPalette,
  1459. [out] BOOL* bStretch);
  1460. };
  1461. [
  1462. object,
  1463. uuid(9757abb8-1b32-11d1-a7ce-00c04fd8d565),
  1464. helpstring("IHeaderCtrl2 Interface, adds filter support"),
  1465. pointer_default(unique)
  1466. ]
  1467. interface IHeaderCtrl2 : IHeaderCtrl
  1468. {
  1469. [helpstring("Sets the time out for filter change notification")]
  1470. HRESULT SetChangeTimeOut([in] unsigned long uTimeout);
  1471. [helpstring("Set filter data")]
  1472. HRESULT SetColumnFilter([in] UINT nColumn, [in] DWORD dwType, [in] MMC_FILTERDATA* pFilterData);
  1473. [helpstring("Get filter data")]
  1474. HRESULT GetColumnFilter([in] UINT nColumn, [in,out] LPDWORD pdwType, [in, out] MMC_FILTERDATA* pFilterData);
  1475. };
  1476. [
  1477. object,
  1478. uuid(4861A010-20F9-11d2-A510-00C04FB6DD2C),
  1479. helpstring("ISnapinHelp2 Interface, adds linked topics support"),
  1480. pointer_default(unique)
  1481. ]
  1482. interface ISnapinHelp2 : ISnapinHelp
  1483. {
  1484. [helpstring("Get additional topic files to merge into help collection")]
  1485. HRESULT GetLinkedTopics([out] LPOLESTR* lpCompiledHelpFiles);
  1486. };
  1487. ///////////////////////////////////////////////////////////////////////////////
  1488. ////
  1489. //// Task Pad
  1490. typedef enum _MMC_TASK_DISPLAY_TYPE
  1491. {
  1492. MMC_TASK_DISPLAY_UNINITIALIZED = 0,
  1493. MMC_TASK_DISPLAY_TYPE_SYMBOL, // fontname, EOT, symbols
  1494. MMC_TASK_DISPLAY_TYPE_VANILLA_GIF, // (GIF) index 0 is transparent
  1495. MMC_TASK_DISPLAY_TYPE_CHOCOLATE_GIF, // (GIF) index 1 is transparent
  1496. MMC_TASK_DISPLAY_TYPE_BITMAP // non-transparent raster
  1497. } MMC_TASK_DISPLAY_TYPE;
  1498. typedef struct _MMC_TASK_DISPLAY_SYMBOL
  1499. {
  1500. LPOLESTR szFontFamilyName; // name of font family
  1501. LPOLESTR szURLtoEOT; // "res://"-type URL to EOT file
  1502. LPOLESTR szSymbolString; // 1 or more symbol characters
  1503. } MMC_TASK_DISPLAY_SYMBOL;
  1504. typedef struct _MMC_TASK_DISPLAY_BITMAP
  1505. {
  1506. LPOLESTR szMouseOverBitmap; // Note: URLs must be fully-qualified
  1507. LPOLESTR szMouseOffBitmap; // ("res://..." type) URLs
  1508. } MMC_TASK_DISPLAY_BITMAP;
  1509. typedef struct _MMC_TASK_DISPLAY_OBJECT
  1510. {
  1511. MMC_TASK_DISPLAY_TYPE eDisplayType;
  1512. [switch_type(MMC_TASK_DISPLAY_TYPE), switch_is((MMC_TASK_DISPLAY_TYPE)eDisplayType)]
  1513. union {
  1514. [case(MMC_TASK_DISPLAY_TYPE_BITMAP,MMC_TASK_DISPLAY_TYPE_VANILLA_GIF,MMC_TASK_DISPLAY_TYPE_CHOCOLATE_GIF)]
  1515. MMC_TASK_DISPLAY_BITMAP uBitmap;
  1516. [case(MMC_TASK_DISPLAY_TYPE_SYMBOL)]
  1517. MMC_TASK_DISPLAY_SYMBOL uSymbol;
  1518. [default];
  1519. };
  1520. } MMC_TASK_DISPLAY_OBJECT;
  1521. typedef enum _MMC_ACTION_TYPE
  1522. {
  1523. MMC_ACTION_UNINITIALIZED = -1,
  1524. MMC_ACTION_ID,
  1525. MMC_ACTION_LINK,
  1526. MMC_ACTION_SCRIPT,
  1527. } MMC_ACTION_TYPE;
  1528. typedef struct _MMC_TASK
  1529. {
  1530. MMC_TASK_DISPLAY_OBJECT sDisplayObject;
  1531. LPOLESTR szText;
  1532. LPOLESTR szHelpString;
  1533. MMC_ACTION_TYPE eActionType; // from enum above
  1534. union
  1535. {
  1536. LONG_PTR nCommandID; // command id (unique number)
  1537. LPOLESTR szActionURL; // either link or scriptlet
  1538. LPOLESTR szScript; // raw script code
  1539. };
  1540. } MMC_TASK;
  1541. typedef struct _MMC_LISTPAD_INFO
  1542. {
  1543. LPOLESTR szTitle; // title for ListView in TaskPad
  1544. LPOLESTR szButtonText; // text for ListView in TaskPad
  1545. LONG_PTR nCommandID; // command id (unique number)
  1546. } MMC_LISTPAD_INFO;
  1547. typedef DWORD MMC_STRING_ID;
  1548. [
  1549. local,
  1550. object,
  1551. uuid(338698b1-5a02-11d1-9fec-00600832db4a),
  1552. helpstring("Implemented by the snapins that want to add tasks"),
  1553. pointer_default(unique)
  1554. ]
  1555. interface IEnumTASK : IUnknown
  1556. {
  1557. HRESULT Next(
  1558. [in] ULONG celt,
  1559. [out, size_is(celt), length_is(*pceltFetched)] MMC_TASK *rgelt,
  1560. [out] ULONG *pceltFetched);
  1561. HRESULT Skip([in] ULONG celt);
  1562. HRESULT Reset();
  1563. HRESULT Clone([out] IEnumTASK **ppenum);
  1564. // Skip and Clone are not called
  1565. // Next will be called 1 at a time (i.e. celt will always be 1)
  1566. // Reset will be called
  1567. };
  1568. [
  1569. local,
  1570. object,
  1571. uuid(8dee6511-554d-11d1-9fea-00600832db4a),
  1572. helpstring("Interface to be supported by those snapins that support taskpads"),
  1573. pointer_default(unique)
  1574. ]
  1575. interface IExtendTaskPad : IUnknown
  1576. {
  1577. // called from script via CIC
  1578. [helpstring("Notify.")]
  1579. HRESULT TaskNotify([in] IDataObject* pdo, [in] VARIANT* arg, [in] VARIANT* param);
  1580. [helpstring("Tasks to be inserted in the task pad.")]
  1581. HRESULT EnumTasks([in] IDataObject * pdo, [in,string] LPOLESTR szTaskGroup,
  1582. [out] IEnumTASK** ppEnumTASK);
  1583. // support for default taskpad
  1584. [helpstring("Title for the default task pad.")]
  1585. HRESULT GetTitle([in,string] LPOLESTR pszGroup, [out,string] LPOLESTR * pszTitle);
  1586. [helpstring("Descriptive Text for the default task pad.")]
  1587. HRESULT GetDescriptiveText([in,string] LPOLESTR pszGroup, [out,string] LPOLESTR * pszDescriptiveText);
  1588. [helpstring("Background for the default task pad.")]
  1589. HRESULT GetBackground([in,string] LPOLESTR pszGroup, [out] MMC_TASK_DISPLAY_OBJECT * pTDO);
  1590. // [helpstring("Branding for the default task pad.")]
  1591. // HRESULT GetBranding([in,string] LPOLESTR pszGroup, [out] MMC_TASK_DISPLAY_OBJECT * pTDO);
  1592. [helpstring("Get ListPad Info.")]
  1593. HRESULT GetListPadInfo ([in,string] LPOLESTR pszGroup, [out] MMC_LISTPAD_INFO * lpListPadInfo);
  1594. };
  1595. [
  1596. object,
  1597. uuid(103D842A-AA63-11D1-A7E1-00C04FD8D565),
  1598. helpstring("IConsole2 Interface"),
  1599. pointer_default(unique)
  1600. ]
  1601. interface IConsole2 : IConsole
  1602. {
  1603. [helpstring("Allows the snap-in to expand/collapse a scope item in the corresponding view. Should be called only by the IConsole associated with a IComponent.")]
  1604. HRESULT Expand([in] HSCOPEITEM hItem, [in] BOOL bExpand);
  1605. [helpstring("Determines if the user prefers taskpad views by default.")]
  1606. HRESULT IsTaskpadViewPreferred();
  1607. [helpstring("Allows the snap-in to change the text on the status bar.")]
  1608. HRESULT SetStatusText ([in, string] LPOLESTR pszStatusText);
  1609. };
  1610. [
  1611. object,
  1612. uuid(cc593830-b926-11d1-8063-0000f875a9ce),
  1613. helpstring("IDisplayHelp Interface"),
  1614. pointer_default(unique)
  1615. ]
  1616. interface IDisplayHelp : IUnknown
  1617. {
  1618. [helpstring("Allows the snap-in to display a help topic.")]
  1619. HRESULT ShowTopic([in] LPOLESTR pszHelpTopic);
  1620. };
  1621. [
  1622. local,
  1623. object,
  1624. uuid(72782D7A-A4A0-11d1-AF0F-00C04FB6DD2C),
  1625. helpstring("Interface for specifying required snap-in extensions"),
  1626. pointer_default(unique)
  1627. ]
  1628. interface IRequiredExtensions : IUnknown
  1629. {
  1630. [helpstring("Enable all extensions")]
  1631. HRESULT EnableAllExtensions();
  1632. [helpstring("Get first required extension")]
  1633. HRESULT GetFirstExtension([out] LPCLSID pExtCLSID);
  1634. [helpstring("Get next required extension")]
  1635. HRESULT GetNextExtension([out] LPCLSID pExtCLSID);
  1636. };
  1637. [
  1638. object,
  1639. uuid(DE40B7A4-0F65-11d2-8E25-00C04F8ECD78),
  1640. helpstring("Interface for accessing strings in a console file"),
  1641. pointer_default(unique)
  1642. ]
  1643. interface IStringTable : IUnknown
  1644. {
  1645. [helpstring("Add a string to the snap-in's string table")]
  1646. HRESULT AddString (
  1647. [in] LPCOLESTR pszAdd, // string to add to the string table
  1648. [out] MMC_STRING_ID* pStringID // ID of added string
  1649. );
  1650. [helpstring("Retrieves a string from the snap-in's string table")]
  1651. HRESULT GetString (
  1652. [in] MMC_STRING_ID StringID, // ID of string
  1653. [in] ULONG cchBuffer, // number of characters in lpBuffer
  1654. [out, size_is(cchBuffer)]
  1655. LPOLESTR lpBuffer, // string corresponding to wStringID
  1656. [out] ULONG* pcchOut // number of characters written to lpBuffer
  1657. );
  1658. [helpstring("Retrieves the length of a string in the snap-in's string table")]
  1659. HRESULT GetStringLength (
  1660. [in] MMC_STRING_ID StringID, // ID of string
  1661. [out] ULONG* pcchString // number of characters in string, not including terminator
  1662. );
  1663. [helpstring("Delete a string from the snap-in's string table")]
  1664. HRESULT DeleteString (
  1665. [in] MMC_STRING_ID StringID // ID of string to delete
  1666. );
  1667. [helpstring("Delete all strings from the snap-in's string table")]
  1668. HRESULT DeleteAllStrings ();
  1669. [helpstring("Find a string in the snap-in's string table")]
  1670. HRESULT FindString (
  1671. [in] LPCOLESTR pszFind, // string to find in the string table
  1672. [out] MMC_STRING_ID* pStringID // ID of string, if found
  1673. );
  1674. [helpstring("Returns an enumerator into a snap-in's string table")]
  1675. HRESULT Enumerate (
  1676. [out] IEnumString** ppEnum // string enumerator
  1677. );
  1678. };
  1679. cpp_quote("#endif // MMC_VER >= 0x0110")
  1680. cpp_quote("#if (MMC_VER >= 0x0120)")
  1681. ///////////////////////////////////////////////////////////////////////////////
  1682. ///////////////////////////////////////////////////////////////////////////////
  1683. ///////////////////////////////////////////////////////////////////////////////
  1684. ///////////////////////////////////////////////////////////////////////////////
  1685. ////
  1686. //// MMC 1.2 changes
  1687. ////
  1688. // Column Flags
  1689. const DWORD HDI_HIDDEN = 0x0001; // Column is hidden.
  1690. // Per Column data.
  1691. typedef struct _MMC_COLUMN_DATA
  1692. {
  1693. int nColIndex; // Column index
  1694. DWORD dwFlags; // Column flags
  1695. int nWidth; // Column width
  1696. ULONG_PTR ulReserved; // For future use
  1697. } MMC_COLUMN_DATA;
  1698. // Column-Set data.
  1699. typedef struct _MMC_COLUMN_SET_DATA
  1700. {
  1701. int cbSize; // Size of this struct.
  1702. int nNumCols; // Number of columns
  1703. MMC_COLUMN_DATA* pColData; // Array of column data
  1704. } MMC_COLUMN_SET_DATA;
  1705. // Sort data.
  1706. typedef struct _MMC_SORT_DATA
  1707. {
  1708. int nColIndex; // Column index
  1709. DWORD dwSortOptions; // Column sort options
  1710. ULONG_PTR ulReserved; // For future use
  1711. } MMC_SORT_DATA;
  1712. // Column sort data.
  1713. typedef struct _MMC_SORT_SET_DATA
  1714. {
  1715. int cbSize; // Size of this struct.
  1716. int nNumItems; // Number of items in the array below.
  1717. MMC_SORT_DATA* pSortData; // Array of column data
  1718. } MMC_SORT_SET_DATA;
  1719. [
  1720. object,
  1721. uuid(547C1354-024D-11d3-A707-00C04F8EF4CB),
  1722. helpstring("Interface for accessing persisted view data."),
  1723. pointer_default(unique)
  1724. ]
  1725. interface IColumnData : IUnknown
  1726. {
  1727. [helpstring("Change the persisted column data for a ColumnSet ID")]
  1728. HRESULT SetColumnConfigData(
  1729. [in] SColumnSetID* pColID,
  1730. [in] MMC_COLUMN_SET_DATA* pColSetData
  1731. );
  1732. [helpstring("Retrieve the persisted column data for a ColumnSet ID")]
  1733. HRESULT GetColumnConfigData(
  1734. [in] SColumnSetID* pColID,
  1735. [out] MMC_COLUMN_SET_DATA** ppColSetData
  1736. );
  1737. [helpstring("Change the persisted column sort data for a ColumnSet ID")]
  1738. HRESULT SetColumnSortData(
  1739. [in] SColumnSetID* pColID,
  1740. [in] MMC_SORT_SET_DATA* pColSortData
  1741. );
  1742. [helpstring("Retrieve the persisted column sort data for a ColumnSet ID")]
  1743. HRESULT GetColumnSortData(
  1744. [in] SColumnSetID* pColID,
  1745. [out] MMC_SORT_SET_DATA** ppColSortData
  1746. );
  1747. };
  1748. [
  1749. object,
  1750. uuid(80F94174-FCCC-11d2-B991-00C04F8ECD78),
  1751. helpstring("Interface for displaying an informational message in the result pane"),
  1752. pointer_default(unique)
  1753. ]
  1754. interface IMessageView : IUnknown
  1755. {
  1756. [helpstring("Change the title for the result pane message")]
  1757. HRESULT SetTitleText(
  1758. [in] LPCOLESTR pszTitleText
  1759. );
  1760. [helpstring("Change the text for the result pane message")]
  1761. HRESULT SetBodyText(
  1762. [in] LPCOLESTR pszBodyText
  1763. );
  1764. typedef enum tagIconIdentifier
  1765. {
  1766. Icon_None = 0,
  1767. Icon_Error = 32513,
  1768. Icon_Question = 32514,
  1769. Icon_Warning = 32515,
  1770. Icon_Information = 32516,
  1771. Icon_First = Icon_Error,
  1772. Icon_Last = Icon_Information,
  1773. } IconIdentifier;
  1774. [helpstring("Change the icon for the result pane message")]
  1775. HRESULT SetIcon(
  1776. [in] IconIdentifier id
  1777. );
  1778. [helpstring("Clears the title, text, and icon of the result pane message")]
  1779. HRESULT Clear();
  1780. };
  1781. typedef struct _RDCITEMHDR
  1782. {
  1783. DWORD dwFlags; // scope item or result item?
  1784. MMC_COOKIE cookie;
  1785. LPARAM lpReserved;
  1786. } RDITEMHDR;
  1787. const DWORD RDCI_ScopeItem = 0x80000000;
  1788. typedef struct _RDCOMPARE
  1789. {
  1790. DWORD cbSize; // size of this structure
  1791. DWORD dwFlags; // reserved, always 0
  1792. int nColumn; // column we're sorting on, maps to in value of
  1793. // IResultDataCompare::Compare's pnResult param
  1794. LPARAM lUserParam; // IResultDataCompare::Compare's lUserParam param
  1795. RDITEMHDR* prdch1; // first item to compare
  1796. RDITEMHDR* prdch2; // second item to compare
  1797. } RDCOMPARE;
  1798. [
  1799. object,
  1800. uuid(96933476-0251-11d3-AEB0-00C04F8ECD78),
  1801. helpstring("Compare interface for sorting items in the result pane"),
  1802. pointer_default(unique)
  1803. ]
  1804. interface IResultDataCompareEx : IUnknown
  1805. {
  1806. [helpstring("Compare items in the result pane")]
  1807. HRESULT Compare([in] RDCOMPARE* prdc, [out] int* pnResult);
  1808. }
  1809. cpp_quote("#endif // MMC_VER >= 0x0120")
  1810. cpp_quote("#if (MMC_VER >= 0x0200)")
  1811. ///////////////////////////////////////////////////////////////////////////////
  1812. ///////////////////////////////////////////////////////////////////////////////
  1813. ///////////////////////////////////////////////////////////////////////////////
  1814. ///////////////////////////////////////////////////////////////////////////////
  1815. ////
  1816. //// MMC 2.0 changes
  1817. ////
  1818. typedef enum _MMC_VIEW_TYPE
  1819. {
  1820. MMC_VIEW_TYPE_LIST,
  1821. MMC_VIEW_TYPE_HTML,
  1822. MMC_VIEW_TYPE_OCX
  1823. } MMC_VIEW_TYPE;
  1824. // dwMiscOptions
  1825. const DWORD RVTI_MISC_OPTIONS_NOLISTVIEWS = 0x0001;
  1826. // dwListOptions - similar to MMC_VIEW_OPTIONS
  1827. const DWORD RVTI_LIST_OPTIONS_NONE = 0x0000;
  1828. const DWORD RVTI_LIST_OPTIONS_OWNERDATALIST = 0x0002;
  1829. const DWORD RVTI_LIST_OPTIONS_MULTISELECT = 0x0004;
  1830. const DWORD RVTI_LIST_OPTIONS_FILTERED = 0x0008;
  1831. const DWORD RVTI_LIST_OPTIONS_USEFONTLINKING = 0x0020;
  1832. const DWORD RVTI_LIST_OPTIONS_EXCLUDE_SCOPE_ITEMS_FROM_LIST = 0x0040;
  1833. const DWORD RVTI_LIST_OPTIONS_LEXICAL_SORT = 0x0080;
  1834. const DWORD RVTI_LIST_OPTIONS_ALLOWPASTE = 0x0100;
  1835. // dwHTMLOptions
  1836. const DWORD RVTI_HTML_OPTIONS_NONE = 0x0000;
  1837. const DWORD RVTI_HTML_OPTIONS_NOLISTVIEW = 0x0001;
  1838. // dwOCXOptions
  1839. const DWORD RVTI_OCX_OPTIONS_NONE = 0x0000;
  1840. const DWORD RVTI_OCX_OPTIONS_NOLISTVIEW = 0x0001;
  1841. const DWORD RVTI_OCX_OPTIONS_CACHE_OCX = 0x0002;
  1842. typedef struct _RESULT_VIEW_TYPE_INFO
  1843. {
  1844. LPOLESTR pstrPersistableViewDescription;
  1845. MMC_VIEW_TYPE eViewType;
  1846. DWORD dwMiscOptions;
  1847. [switch_type(MMC_VIEW_TYPE), switch_is((MMC_VIEW_TYPE)eViewType)]
  1848. union
  1849. {
  1850. [case(MMC_VIEW_TYPE_LIST)]
  1851. DWORD dwListOptions;
  1852. [case(MMC_VIEW_TYPE_HTML)]
  1853. struct
  1854. {
  1855. DWORD dwHTMLOptions; // must be zero for future expansion.
  1856. LPOLESTR pstrURL;
  1857. };
  1858. [case(MMC_VIEW_TYPE_OCX)]
  1859. struct
  1860. {
  1861. DWORD dwOCXOptions;
  1862. LPUNKNOWN pUnkControl;
  1863. };
  1864. [default];
  1865. };
  1866. } RESULT_VIEW_TYPE_INFO, *PRESULT_VIEW_TYPE_INFO;
  1867. //#######################################################################
  1868. //#######################################################################
  1869. //
  1870. // Clipboard formats used by the built-in view extension
  1871. //
  1872. //#######################################################################
  1873. //#######################################################################
  1874. const wchar_t* CCF_DESCRIPTION = L"CCF_DESCRIPTION"; // text only
  1875. const wchar_t* CCF_HTML_DETAILS = L"CCF_HTML_DETAILS"; // interpreted as HTML
  1876. //#######################################################################
  1877. //#######################################################################
  1878. //
  1879. // struct CONTEXTMENUITEM2: Adds a language independent name.
  1880. //
  1881. //#######################################################################
  1882. //#######################################################################
  1883. typedef struct _CONTEXTMENUITEM2
  1884. {
  1885. LPWSTR strName;
  1886. LPWSTR strStatusBarText;
  1887. LONG lCommandID;
  1888. LONG lInsertionPointID;
  1889. LONG fFlags;
  1890. LONG fSpecialFlags;
  1891. LPWSTR strLanguageIndependentName;
  1892. } CONTEXTMENUITEM2;
  1893. typedef CONTEXTMENUITEM2* LPCONTEXTMENUITEM2;
  1894. //#######################################################################
  1895. //#######################################################################
  1896. //
  1897. // struct MMC_EXT_VIEW_DATA: definition of a view supplied by a view extension
  1898. //
  1899. //#######################################################################
  1900. //#######################################################################
  1901. typedef struct _MMC_EXT_VIEW_DATA
  1902. {
  1903. GUID viewID; // GUID used to describe the view. Used to restore a view.
  1904. LPCOLESTR pszURL; // URL describing extension page
  1905. LPCOLESTR pszViewTitle; // title of the view extension
  1906. LPCOLESTR pszTooltipText; // tooltip for the tab
  1907. BOOL bReplacesDefaultView; // TRUE == no "Normal" tab
  1908. } MMC_EXT_VIEW_DATA, *PMMC_EXT_VIEW_DATA;
  1909. //#######################################################################
  1910. //#######################################################################
  1911. //
  1912. // MMCN_QUERY_PASTE flags: The param is used as out parameter which
  1913. // can define below flags.
  1914. //
  1915. //#######################################################################
  1916. //#######################################################################
  1917. const DWORD MMC_DEFAULT_OPERATION_COPY = 0x0001;
  1918. //#######################################################################
  1919. //#######################################################################
  1920. //
  1921. // The IComponentData2 interface
  1922. //
  1923. //#######################################################################
  1924. //#######################################################################
  1925. [
  1926. object,
  1927. uuid(CCA0F2D2-82DE-41B5-BF47-3B2076273D5C),
  1928. helpstring("IComponentData2 Interface"),
  1929. pointer_default(unique)
  1930. ]
  1931. interface IComponentData2 : IComponentData
  1932. {
  1933. [helpstring("Returns a Dispatch interface which may be used to perform actions for the specified cookie.")]
  1934. HRESULT QueryDispatch([in] MMC_COOKIE cookie, [in] DATA_OBJECT_TYPES type,
  1935. [out] LPDISPATCH* ppDispatch);
  1936. };
  1937. //#######################################################################
  1938. //#######################################################################
  1939. //
  1940. // The IComponent2 interface
  1941. //
  1942. //#######################################################################
  1943. //#######################################################################
  1944. [
  1945. object,
  1946. uuid(79A2D615-4A10-4ED4-8C65-8633F9335095),
  1947. helpstring("IComponent2 Interface"),
  1948. pointer_default(unique)
  1949. ]
  1950. interface IComponent2 : IComponent
  1951. {
  1952. [helpstring("Returns a Dispatch interface which may be used to perform actions for the specified cookie.")]
  1953. HRESULT QueryDispatch([in] MMC_COOKIE cookie, [in] DATA_OBJECT_TYPES type,
  1954. [out] LPDISPATCH* ppDispatch);
  1955. [helpstring("Gets the result view type. Supersedes the GetResultViewType method.")]
  1956. HRESULT GetResultViewType2([in] MMC_COOKIE cookie, [in, out] PRESULT_VIEW_TYPE_INFO pResultViewType);
  1957. [helpstring("Restores the result view. Supersedes the MMCN_RESTORE notification")]
  1958. HRESULT RestoreResultView([in] MMC_COOKIE cookie, [in] PRESULT_VIEW_TYPE_INFO pResultViewType);
  1959. };
  1960. //#######################################################################
  1961. //#######################################################################
  1962. //
  1963. // The IContextMenuCallback2 interface
  1964. //
  1965. //#######################################################################
  1966. //#######################################################################
  1967. [
  1968. object,
  1969. uuid(E178BC0E-2ED0-4b5e-8097-42C9087E8B33),
  1970. helpstring("IContextMenuCallback2 Interface"),
  1971. pointer_default(unique)
  1972. ]
  1973. interface IContextMenuCallback2 : IUnknown
  1974. {
  1975. // returns S_OK if the item was added
  1976. // returns E_INVALIDARG if given a NULL pointer
  1977. // returns E_INVALIDARG if an item already exists with this lCommandID
  1978. // returns E_INVALIDARG if insertion point ID could not be found
  1979. // returns E_INVALIDARG if command ID or insertion point ID is invalid
  1980. // returns E_INVALIDARG if fFlags contains MF_OWNERDRAW or MF_BITMAP
  1981. // returns E_INVALIDARG if an extension attempts to add an item where
  1982. // fFlags contains MF_SEPARATOR or fSpecialFlags contains CCM_SPECIAL_SEPARATOR
  1983. // except in submenus created by extensions
  1984. // otherwise an unexpected error occurred
  1985. [helpstring("Adds one item to context menu")]
  1986. HRESULT AddItem([in] CONTEXTMENUITEM2* pItem);
  1987. };
  1988. //#######################################################################
  1989. //#######################################################################
  1990. //
  1991. // The IMMCVersion interface
  1992. //
  1993. //#######################################################################
  1994. //#######################################################################
  1995. [
  1996. uuid(A8D2C5FE-CDCB-4b9d-BDE5-A27343FF54BC),
  1997. helpstring("IMMCVersionInfo Interface"),
  1998. ]
  1999. interface IMMCVersionInfo : IUnknown
  2000. {
  2001. [helpstring("Returns the version information about the installed version of MMC")]
  2002. HRESULT GetMMCVersion([out] long * pVersionMajor, [out] long * pVersionMinor);
  2003. }
  2004. //#######################################################################
  2005. //#######################################################################
  2006. //
  2007. // The MMCVersion type library
  2008. //
  2009. //#######################################################################
  2010. //#######################################################################
  2011. [
  2012. uuid(9EECDD85-B715-4188-8A72-61159ABDB8C4),
  2013. version(1.0),
  2014. helpstring("MMCVersion Type Library")
  2015. ]
  2016. library MMCVersionLib
  2017. {
  2018. importlib("stdole2.tlb");
  2019. [
  2020. helpstring("MMCVersionInfo coclass"),
  2021. uuid(D6FEDB1D-CF21-4bd9-AF3B-C5468E9C6684)
  2022. ]
  2023. coclass MMCVersionInfo
  2024. {
  2025. [default] interface IMMCVersionInfo;
  2026. };
  2027. [
  2028. helpstring("ConsolePower coclass"),
  2029. uuid(f0285374-dff1-11d3-b433-00c04f8ecd78)
  2030. ]
  2031. coclass ConsolePower
  2032. {
  2033. [default] interface IConsolePower;
  2034. };
  2035. };
  2036. //#######################################################################
  2037. //#######################################################################
  2038. //
  2039. // The IExtendView interface
  2040. //
  2041. //#######################################################################
  2042. //#######################################################################
  2043. [
  2044. object,
  2045. uuid(89995CEE-D2ED-4c0e-AE5E-DF7E76F3FA53),
  2046. helpstring("IExtendView Interface"),
  2047. pointer_default(unique)
  2048. ]
  2049. interface IExtendView : IUnknown
  2050. {
  2051. [helpstring("Returns the view extension's information")]
  2052. HRESULT GetViews (
  2053. [in] LPDATAOBJECT pDataObject,
  2054. [in] LPVIEWEXTENSIONCALLBACK pViewExtensionCallback);
  2055. };
  2056. //#######################################################################
  2057. //#######################################################################
  2058. //
  2059. // The IViewExtensionCallback interface
  2060. //
  2061. //#######################################################################
  2062. //#######################################################################
  2063. [
  2064. object,
  2065. uuid(34DD928A-7599-41E5-9F5E-D6BC3062C2DA),
  2066. helpstring("IViewExtensionCallback Interface"),
  2067. pointer_default(unique)
  2068. ]
  2069. interface IViewExtensionCallback : IUnknown
  2070. {
  2071. [helpstring("Adds a view to the result pane")]
  2072. HRESULT AddView([in] PMMC_EXT_VIEW_DATA pExtViewData);
  2073. }
  2074. //#######################################################################
  2075. //#######################################################################
  2076. //
  2077. // The IConsolePower interface
  2078. //
  2079. //#######################################################################
  2080. //#######################################################################
  2081. [
  2082. object,
  2083. uuid(1cfbdd0e-62ca-49ce-a3af-dbb2de61b068),
  2084. helpstring("IConsolePower Interface"),
  2085. pointer_default(unique)
  2086. ]
  2087. interface IConsolePower : IUnknown
  2088. {
  2089. [helpstring("Sets the execution state for the current thread")]
  2090. HRESULT SetExecutionState ([in] DWORD dwAdd, [in] DWORD dwRemove);
  2091. [helpstring("Resets the given idle timer(s)")]
  2092. HRESULT ResetIdleTimer ([in] DWORD dwFlags);
  2093. };
  2094. //#######################################################################
  2095. //#######################################################################
  2096. //
  2097. // The IConsolePowerSink interface
  2098. //
  2099. //#######################################################################
  2100. //#######################################################################
  2101. [
  2102. object,
  2103. uuid(3333759f-fe4f-4975-b143-fec0a5dd6d65),
  2104. helpstring("IConsolePowerSink Interface"),
  2105. pointer_default(unique)
  2106. ]
  2107. interface IConsolePowerSink : IUnknown
  2108. {
  2109. [helpstring("Handler for WM_POWERBROADCAST notification")]
  2110. HRESULT OnPowerBroadcast (
  2111. [in] UINT nEvent, // power-management event
  2112. [in] LPARAM lParam, // event-specific data
  2113. [out] LRESULT* plReturn); // event-specific return code
  2114. };
  2115. //#######################################################################
  2116. //#######################################################################
  2117. //
  2118. // The INodeProperties interface
  2119. //
  2120. //#######################################################################
  2121. //#######################################################################
  2122. [
  2123. object,
  2124. uuid(15BC4D24-A522-4406-AA55-0749537A6865),
  2125. helpstring("INodeProperties Interface"),
  2126. pointer_default(unique)
  2127. ]
  2128. interface INodeProperties : IUnknown
  2129. {
  2130. [helpstring("Returns text-only properties for a node")]
  2131. HRESULT GetProperty([in] LPDATAOBJECT pDataObject, [in] BSTR szPropertyName, [out] PBSTR pbstrProperty);
  2132. };
  2133. //#######################################################################
  2134. //#######################################################################
  2135. //
  2136. // The IConsole3 interface
  2137. //
  2138. //#######################################################################
  2139. //#######################################################################
  2140. [
  2141. object,
  2142. uuid(4F85EFDB-D0E1-498c-8D4A-D010DFDD404F),
  2143. helpstring("IConsole3 Interface"),
  2144. pointer_default(unique)
  2145. ]
  2146. interface IConsole3 : IConsole2
  2147. {
  2148. [helpstring("Puts the specified scope item into rename mode.")]
  2149. HRESULT RenameScopeItem([in] HSCOPEITEM hScopeItem);
  2150. };
  2151. //#######################################################################
  2152. //#######################################################################
  2153. //
  2154. // The IResultData2 interface
  2155. //
  2156. //#######################################################################
  2157. //#######################################################################
  2158. [
  2159. object,
  2160. uuid(0F36E0EB-A7F1-4a81-BE5A-9247F7DE4B1B),
  2161. helpstring("IResultData2 Interface"),
  2162. pointer_default(unique)
  2163. ]
  2164. interface IResultData2 : IResultData
  2165. {
  2166. [helpstring("Puts the specified result item into rename mode.")]
  2167. HRESULT RenameResultItem([in] HRESULTITEM itemID);
  2168. };
  2169. cpp_quote("#endif // MMC_VER >= 0x0200")