home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / mprui.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  5KB  |  202 lines

  1. /*++
  2.  
  3. Copyright (c) 1996, Microsoft Corporation
  4.  
  5. Module Name:
  6.     mprui.h
  7.  
  8. Abstract:
  9.     Declarations for the Multi-Protocol router's UI plugin interface.
  10.  
  11. --*/
  12.  
  13. // forward declarations
  14. #ifdef _cplusplus
  15.   struct IMprUIHost;
  16.   struct IMprUIPlugin;
  17. #else
  18.   typedef struct IMprUIHost IMprUIHost;
  19.   typedef struct IMprUIPlugin IMprUIPlugin;
  20. #endif
  21.  
  22. // {73A827F0-FF6E-11cf-AA6B-00805F0C9232}
  23. DEFINE_GUID(IID_IMprUIHost, 
  24. 0x73a827f0, 0xff6e, 0x11cf, 0xaa, 0x6b, 0x0, 0x80, 0x5f, 0xc, 0x92, 0x32);
  25.  
  26. // {73A827F1-FF6E-11cf-AA6B-00805F0C9232}
  27. DEFINE_GUID(IID_IMprUIPlugin, 
  28. 0x73a827f1, 0xff6e, 0x11cf, 0xaa, 0x6b, 0x0, 0x80, 0x5f, 0xc, 0x92, 0x32);
  29.  
  30. #undef INTERFACE
  31. #define INTERFACE IMprUIHost
  32.  
  33. DECLARE_INTERFACE_(IMprUIHost, IUnknown)
  34. {
  35.   // *** IUnknown methods ***
  36.   STDMETHOD(QueryInterface) (
  37.     THIS_
  38.     REFIID riid,
  39.     LPVOID FAR* ppvObj
  40.     ) PURE;
  41.   
  42.   STDMETHOD_(ULONG,AddRef) (
  43.     THIS
  44.     ) PURE;
  45.   
  46.   STDMETHOD_(ULONG,Release) (
  47.     THIS
  48.     ) PURE;
  49.  
  50.   // *** IMprUIHost methods ***
  51.  
  52.   // Create a floating window for the given control
  53.   //  Use CoTaskMemAlloc to allocate pszTitle
  54.   STDMETHOD(FloatWindow) (
  55.     THIS_
  56.     REFCLSID rguidModule,            // CLSID representing the object
  57.     REFCLSID rclsidCtrl,             // CLSID of Ole Control to create
  58.     IMprUIPlugin* pConnection,       // Plugin in node making request
  59.     DWORD dwContext,                 // constant context passed back to Ole Control
  60.     PWCHAR pszTitle                  // Title of floating window
  61.     ) PURE;
  62.  
  63.   // Force all nodes to be refreshed
  64.   STDMETHOD(GlobalRefresh) (
  65.     THIS
  66.     ) PURE;
  67. };
  68.  
  69. #undef INTERFACE
  70. #define INTERFACE IMprUIPlugin
  71.  
  72. DECLARE_INTERFACE_(IMprUIPlugin, IUnknown)
  73. {
  74.   // *** IUnknown methods ***
  75.   STDMETHOD(QueryInterface) (
  76.     THIS_
  77.     REFIID riid,
  78.     LPVOID FAR* ppvObj
  79.     ) PURE;
  80.   
  81.   STDMETHOD_(ULONG,AddRef) (
  82.     THIS
  83.     ) PURE;
  84.   
  85.   STDMETHOD_(ULONG,Release) (
  86.     THIS
  87.     ) PURE;
  88.  
  89.   // *** IMprUIPlugin Methods ***
  90.   
  91.   // Connect to router.  The plugin module should disconnect from the
  92.   //  router when the IMprUIPlugin is released.
  93.   STDMETHOD(ConnectToRouter) (
  94.     THIS_
  95.     LPCTSTR pRouterName,
  96.     IMprUIHost *pMprUIHost
  97.     ) PURE;
  98.  
  99.   // Returns the text for the given node.
  100.   //  Use CoTaskMemAlloc to allocate memory for ppszTitle
  101.   STDMETHOD(GetTitle) (
  102.     THIS_
  103.     PWSTR*      ppszTitle
  104.     ) PURE;
  105.  
  106.   // Returns a context menu for the given node.
  107.   //  Menu will be destroyed by host.
  108.   STDMETHOD(GetContextMenu) (
  109.     THIS_
  110.     HMENU*      phMenu
  111.     ) PURE;
  112.  
  113.   // Processes the command returned by the context menu
  114.   // There are reserved commands (used to pass down the Hotkeys)
  115.   // such as IDM_HOTKEY_INSERT, IDM_HOTKEY_DELETE, and
  116.   // IDM_HOTKEY_RETURN.  These commands are to be assigned to
  117.   // the appropriate task by the implementor of this interface.
  118.   STDMETHOD(ProcessCommand) (
  119.     THIS_
  120.     WPARAM      wParam,
  121.     LPARAM      lParam,
  122.     HWND        hWndParent
  123.     ) PURE;
  124.  
  125.   // Returns CLSID for the ole control which displays right hand pane
  126.   //  Use CoTaskMemAlloc to allocate space for CLSID*
  127.   STDMETHOD(GetCLSID) (
  128.     THIS_
  129.     CLSID**     ppClsid
  130.     ) PURE;
  131. };
  132.  
  133. #define IDM_HOTKEY_INSERT        (1024)
  134. #define IDM_HOTKEY_DELETE        (1025)
  135. #define IDM_HOTKEY_RETURN        (1026)
  136.  
  137. /* name mangling off */
  138. #ifdef __cplusplus
  139. extern "C" {
  140. #endif
  141.  
  142. typedef DWORD
  143. (APIENTRY* PFNMPRUITRANSPORTCONFIG)(
  144.     IN      HWND        hwndParent,
  145.     IN      LPCWSTR     pwsMachine,
  146.     IN      DWORD       dwTransportId,
  147.     IN      DWORD       dwReserved
  148.     );
  149.  
  150. #define MPRUITRANSPORTCONFIG                    MprUITransportConfig
  151. #define SZMPRUITRANSPORTCONFIG                  "MprUITransportConfig"
  152.  
  153.  
  154. typedef DWORD
  155. (APIENTRY* PFNMPRUIPROTOCOLCONFIG)(
  156.     IN      HWND        hwndParent,
  157.     IN      LPCWSTR     pwsMachine,
  158.     IN      DWORD       dwTransportId,
  159.     IN      DWORD       dwProtocolId,
  160.     IN      DWORD       dwReserved
  161.     );
  162.  
  163. #define MPRUIPROTOCOLCONFIG                     MprUIProtocolConfig
  164. #define SZMPRUIPROTOCOLCONFIG                   "MprUIProtocolConfig"
  165.  
  166.  
  167.  
  168. typedef DWORD
  169. (APIENTRY* PFNMPRUITRANSPORTINTERFACECONFIG)(
  170.     IN      HWND        hwndParent,
  171.     IN      LPCWSTR     pwsMachine,
  172.     IN      LPCWSTR     pwsInterface,
  173.     IN      DWORD       dwIfType,
  174.     IN      DWORD       dwTransportId,
  175.     IN      DWORD       dwReserved
  176.     );
  177.  
  178. #define MPRUITRANSPORTINTERFACECONFIG           MprUITransportInterfaceConfig
  179. #define SZMPRUITRANSPORTINTERFACECONFIG         "MprUITransportInterfaceConfig"
  180.  
  181.  
  182.  
  183. typedef DWORD
  184. (APIENTRY* PFNMPRUIPROTOCOLINTERFACECONFIG)(
  185.     IN      HWND        hwndParent,
  186.     IN      LPCWSTR     pwsMachine,
  187.     IN      LPCWSTR     pwsInterface,
  188.     IN      DWORD       dwIfType,
  189.     IN      DWORD       dwTransportId,
  190.     IN      DWORD       dwProtocolId,
  191.     IN      DWORD       dwReserved
  192.     );
  193.  
  194. #define MPRUIPROTOCOLINTERFACECONFIG            MprUIProtocolInterfaceConfig
  195. #define SZMPRUIPROTOCOLINTERFACECONFIG          "MprUIProtocolInterfaceConfig"
  196.  
  197.  
  198. #ifdef __cplusplus
  199. }
  200. #endif
  201.  
  202.