home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------
- // mmcInterfaces.cs
- //
- // Contains definitions for various interfaces used by a MMC snapin
- //
- // NOTE: This is not an all-encompasing list of every interface
- // available to a snapin
- //-------------------------------------------------------------
-
- using System;
- using System.Runtime.InteropServices;
-
- namespace Microsoft.SampleMMC
- {
-
- //-------------------------------------------------------------
- // Note on all interfaces:
- //
- // Though C# and NGWS intend to use namespaces to replace GUIDs,
- // they must still be used here with every interface. This is
- // necessary because, when creating a MMC snapin, we are dealing
- // with a classic COM server and client; hence, we must use the
- // GUIDs so the classic COM portion of MMC does not get
- // confused.
- //-------------------------------------------------------------
-
- //------------------------------------------\\
- // Interfaces that need to be implemented \\
- //------------------------------------------\\
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("955AB28A-5218-11D0-A985-00C04FD8D565")]
- public interface IComponentData
- {
- void Initialize([MarshalAs(UnmanagedType.Interface)] Object pUnknown);
- void CreateComponent(out IComponent ppComponent);
- void Notify(IDataObject lpDataObject, uint aevent, int arg, int param);
- void Destroy();
- void QueryDataObject(int cookie, uint type, out IDataObject ppDataObject);
- void GetDisplayInfo(ref SCOPEDATAITEM ResultDataItem);
- void CompareObjects(IDataObject lpDataObjectA, IDataObject lpDataObjectB);
- }// interface IComponentData
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("43136EB2-D36C-11CF-ADBC-00AA00A80033")]
- public interface IComponent
- {
- void Initialize([MarshalAs(UnmanagedType.Interface)]Object lpConsole);
- void Notify(IDataObject lpDataObject, uint aevent, int arg, int param);
- void Destroy(int cookie);
- void QueryDataObject(int cookie, uint type, out IDataObject ppDataObject);
- void GetResultViewType(int cookie, out int ppViewType, out int pViewOptions);
- void GetDisplayInfo(ref RESULTDATAITEM ResultDataItem);
- void CompareObjects(IDataObject lpDataObjectA, IDataObject lpDataObjectB);
- }// interface IComponent
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("1245208C-A151-11D0-A7D7-00C04FD909DD")]
- public interface ISnapinAbout
- {
- void GetSnapinDescription(out int lpDescription);
- void GetProvider(out int pName);
- void GetSnapinVersion(out int lpVersion);
- void GetSnapinImage(out int hAppIcon);
- void GetStaticFolderImage(out int hSmallImage, out int hSmallImageOpen, out int hLargeImage, out int cMask);
- }// interface ISnapinAbout
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("0000010e-0000-0000-C000-000000000046")]
- public interface IDataObject
- {
- void GetData(ref FORMATETC a, ref STGMEDIUM b);
- void GetDataHere(ref FORMATETC a, ref STGMEDIUM b);
- void QueryGetData(ref FORMATETC a);
- void GetCanonicalFormatEtc(ref FORMATETC a, out FORMATETC b);
- void SetData(ref FORMATETC a, ref userFLAG_STGMEDIUM b, int c);
- void EnumFormatEtc(uint a, out Object b);
- void DAdvise(ref FORMATETC a, uint b, ref Object c, out uint d);
- void DUnadvise(uint a);
- void EnumDAdvise(out Object a);
- }// interface IDataObject
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("4861A010-20F9-11d2-A510-00C04FB6DD2C")]
- public interface ISnapinHelp2
- {
- void GetHelpTopic(out int lpCompiledHelpFile);
- void GetLinkedTopics(out int lpCompiledHelpFiles);
- }// ISnapinHelp2
-
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("cc593830-b926-11d1-8063-0000f875a9ce")]
- public interface IDisplayHelp
- {
- void ShowTopic([MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] String pszHelpTopic);
- }// IDisplayHelp
-
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("4F3B7A4F-CFAC-11CF-B8E3-00C04FD8D5B0")]
- public interface IExtendContextMenu
- {
- void AddMenuItems(IDataObject piDataObject, IContextMenuCallback piCallback, ref int pInsertionAllowed);
- void Command(int lCommandID, IDataObject piDataObject);
- }// IExtendContextMenu
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("49506520-6F40-11D0-A98B-00C04FD8D565")]
- public interface IExtendControlbar
- {
- void SetControlbar(IControlbar pControlbar);
- void ControlbarNotify(uint aevent, int arg, int param);
- }// IExtendControlbar
-
-
- //------------------------------------------\\
- // Interfaces implemented by MMC \\
- // (No need to implement them... yeah!) \\
- //------------------------------------------\\
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("85DE64DE-EF21-11cf-A285-00C04FD8DBE6")]
- public interface IPropertySheetProvider
- {
- void CreatePropertySheet([MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] String title, int type, int cookie, IDataObject pIDataObjectm, uint dwOptions);
- void FindPropertySheet(int cookie, IComponent lpComponent, IDataObject lpDataObject);
- void AddPrimaryPages([MarshalAs(UnmanagedType.Interface)]Object lpUnknown, int bCreateHandle, int hNotifyWindow,int bScopePane);
- void AddExtensionPages();
- void Show(int window, int page);
- }// IPropertySheetProvider
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("85DE64DD-EF21-11cf-A285-00C04FD8DBE6")]
- public interface IPropertySheetCallback
- {
- void AddPage(int hPage);
- void RemovePage(int hPage);
- }// IPropertySheetCallback
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("85DE64DC-EF21-11cf-A285-00C04FD8DBE6")]
- public interface IExtendPropertySheet
- {
- void CreatePropertyPages(IPropertySheetCallback lpProvider, int handle, IDataObject lpIDataObject);
- void QueryPagesFor(IDataObject lpDataObject);
- }// IExtendPropertySheet
-
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("255F18CC-65DB-11D1-A7DC-00C04FD8D565")]
- public interface IConsoleNameSpace2
- {
- void InsertItem(ref SCOPEDATAITEM a);
- void DeleteItem(uint a, int b);
- void SetItem(ref SCOPEDATAITEM a);
- void GetItem(ref SCOPEDATAITEM a);
- void GetChildItem(uint a, ref uint b, ref int c);
- void GetNextItem(uint a, ref uint b, ref int c);
- void GetParentItem(uint a, ref uint b, ref int c);
- void Expand(uint a);
- void AddExtension(CLSID a, ref SCOPEDATAITEM b);
- }// IConsoleNameSpace2
-
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("43136EB3-D36C-11CF-ADBC-00AA00A80033")]
- public interface IHeaderCtrl
- {
- void InsertColumn(int nCol, [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] String title,int nFormat,int nWidth);
- void DeleteColumn(int nCol);
- void SetColumnText(int nCol, [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] String title);
- void GetColumnText(int nCol,out int pText);
- void SetColumnWidth(int nCol, int nWidth);
- void GetColumnWidth(int nCol, out int pWidth);
- }// IHeaderCtrl
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("31DA5FA0-E0EB-11cf-9F21-00AA003CA9F6")]
- public interface IResultData
- {
- void InsertItem(ref RESULTDATAITEM item);
- void DeleteItem(uint itemID, int nCol);
- void FindItemByLParam(int lParam, out uint pItemID);
- void DeleteAllRsltItems();
- void SetItem(ref RESULTDATAITEM item);
- void GetItem(ref RESULTDATAITEM item);
- void GetNextItem(ref RESULTDATAITEM item);
- void ModifyItemState(int nIndex, uint itemID, uint uAdd, uint uRemove);
- void ModifyViewStyle(int add, int remove);
- void SetViewMode(int lViewMode);
- void GetViewMode(out int lViewMode);
- void UpdateItem(uint itemID);
- void Sort(int nColumn, uint dwSortOptions, int lUserParam);
- void SetDescBarText([MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] ref String DescText);
- void SetItemCount(int nItemCount, uint dwOptions);
- }// IResultData
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("43136EB8-D36C-11CF-ADBC-00AA00A80033")]
- public interface IImageList
- {
- void ImageListSetIcon(int pIcon, int nLoc);
- void ImageListSetStrip(int pBMapSm, int pBMapLg, int nStartLoc, int cMask);
- }// IImageList
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("103D842A-AA63-11D1-A7E1-00C04FD8D565")]
- public interface IConsole2
- {
- void SetHeader(ref IHeaderCtrl pHeader);
- void SetToolbar([MarshalAs(UnmanagedType.Interface)] ref Object pToolbar); // Needs to be LPTOOLBAR
- void QueryResultView([MarshalAs(UnmanagedType.Interface)] out Object pUnknown);
- void QueryScopeImageList(out IImageList ppImageList);
- void QueryResultImageList(out IImageList ppImageList);
- void UpdateAllViews(IDataObject lpDataObject, int data, int hint);
- void MessageBox([MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] String lpszText, [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] String lpszTitle, uint fuStyle, ref int piRetval);
- void QueryConsoleVerb(out IConsoleVerb ppConsoleVerb);
- void SelectScopeItem(int hScopeItem);
- void GetMainWindow(ref int phwnd);
- void NewWindow(int hScopeItem, uint lOptions);
- void Expand(int hItem, int bExpand);
- void IsTaskpadViewPreferred();
- void SetStatusText([MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]String pszStatusText);
- }// IConsole2
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("43136EB7-D36C-11CF-ADBC-00AA00A80033")]
- public interface IContextMenuCallback
- {
- void AddItem(ref CONTEXTMENUITEM pItem);
- }// IContextMenuCallback
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("69FB811E-6C1C-11D0-A2CB-00C04FD909DD")]
- public interface IControlbar
- {
- void Create(MMC_CONTROL_TYPE nType, IExtendControlbar pExtendControlbar, [MarshalAs(UnmanagedType.Interface)] out Object ppUnknown);
- void Attach(MMC_CONTROL_TYPE nType, [MarshalAs(UnmanagedType.Interface)] Object lpUnknown);
- void Detach([MarshalAs(UnmanagedType.Interface)] Object lpUnknown);
- }// IControlbar
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("43136EB9-D36C-11CF-ADBC-00AA00A80033")]
- public interface IToolbar
- {
- void AddBitmap(int nImages, int hbmp, int cxSize, int cySize, int crMask);
- void AddButtons(int nButtons, ref MMCBUTTON lpButtons);
- void InsertButton(int nIndex, ref MMCBUTTON lpButton);
- void DeleteButton(int nIndex);
- void GetButtonState(int idCommand, MMC_BUTTON_STATE nState, out int pState);
- void SetButtonState(int idCommand, MMC_BUTTON_STATE nState, int bState);
- }// IToolbar
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("E49F7A60-74AF-11D0-A286-00C04FD8FE93")]
- public interface IConsoleVerb
- {
- void GetVerbState(uint eCmdID, uint nState, ref int pState);
- void SetVerbState(uint eCmdID, uint nState, int bState);
- void SetDefaultVerb(uint eCmdID);
- void GetDefaultVerb(ref uint peCmdID);
- }// IConsoleVerb
-
- //--------------------------------------------------------------------
- // The following interfaces are not MMC specific interfaces and do not
- // need to be implemented, but their details must be known by the snapin;
- // thus, we're defining them here. I don't make any guarantees that the
- // interfaces are 100% accurate.... I could be missing "ref" or have extra
- // "ref" parameters in these. I only know for certain that Write works.
- //--------------------------------------------------------------------
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("0c733a30-2a1c-11ce-ade5-00aa0044773d")]
- public interface ISequentialStream
- {
- void Read(int pv, uint cb, out uint pcbRead);
- void Write(int pv, uint cb, out uint pcbWritten);
- }// ISequentialStream
-
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("0000000c-0000-0000-C000-000000000046")]
- public interface IStream : ISequentialStream
- {
- void Seek(long dlibMove, uint dwOrigin, out ulong plibNewPosition);
- void SetSize(ulong libNewSize);
- void CopyTo(IStream pstm, ulong cb, out ulong pcbRead, out ulong pcbWritten);
- void Commit(uint grfCommitFlags);
- void Revert();
- void LockRegion(ulong libOffset, ulong cb, uint dwLockType);
- void UnlockRegion(ulong libOffset, ulong cb, uint dwLockType);
- void Stat(out STATSTG pstatstg, uint grfStatFlag);
- void Clone(out IStream ppstm);
- }// IStream
-
- }// namespace Microsoft.SampleMMC
-