Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
3.3 KiB

  1. // Comp.h : Declaration of the CComp
  2. // The View class
  3. //
  4. // The view is per console
  5. #ifndef __COMP_H_
  6. #define __COMP_H_
  7. #include <mmc.h>
  8. class CConNode;
  9. class CComp;
  10. //
  11. // Defered connection info
  12. //
  13. typedef struct tagTSSNAPIN_DEFER_CONNECT
  14. {
  15. CComp* pComponent;
  16. CConNode* pConnectionNode;
  17. } TSSNAPIN_DEFER_CONNECT, *PTSSNAPIN_DEFER_CONNECT;
  18. class ATL_NO_VTABLE CComp :
  19. public CComObjectRootEx<CComSingleThreadModel>,
  20. public IExtendContextMenu,
  21. public IComponent,
  22. public IPersistStreamInit
  23. {
  24. public:
  25. DECLARE_NOT_AGGREGATABLE( CComp )
  26. BEGIN_COM_MAP( CComp )
  27. COM_INTERFACE_ENTRY( IComponent )
  28. COM_INTERFACE_ENTRY( IExtendContextMenu )
  29. COM_INTERFACE_ENTRY( IPersistStreamInit )
  30. END_COM_MAP()
  31. public:
  32. CComp();
  33. ~CComp();
  34. STDMETHOD( Initialize )( LPCONSOLE );
  35. STDMETHOD( Notify )( LPDATAOBJECT , MMC_NOTIFY_TYPE , LPARAM , LPARAM );
  36. STDMETHOD( Destroy )( MMC_COOKIE );
  37. STDMETHOD( GetResultViewType )( MMC_COOKIE , LPOLESTR* , PLONG );
  38. STDMETHOD( QueryDataObject )( MMC_COOKIE , DATA_OBJECT_TYPES , LPDATAOBJECT* );
  39. STDMETHOD( GetDisplayInfo )( LPRESULTDATAITEM );
  40. STDMETHOD( CompareObjects )( LPDATAOBJECT , LPDATAOBJECT );
  41. HRESULT OnShow( LPDATAOBJECT , BOOL );
  42. HRESULT InsertItemsinResultPane( );
  43. HRESULT AddSettingsinResultPane( );
  44. HRESULT OnSelect( LPDATAOBJECT , BOOL , BOOL );
  45. HRESULT SetCompdata( CCompdata * );
  46. // IPersistStreamInit
  47. STDMETHOD(GetClassID)(CLSID *pClassID)
  48. {
  49. UNREFERENCED_PARAMETER(pClassID);
  50. ATLTRACENOTIMPL(_T("CCOMP::GetClassID"));
  51. }
  52. STDMETHOD(IsDirty)()
  53. {
  54. //
  55. // The implementation is CCompdata::IsDirty will do all the work
  56. //
  57. return S_FALSE;
  58. }
  59. STDMETHOD(Load)(IStream *pStm)
  60. {
  61. UNREFERENCED_PARAMETER(pStm);
  62. ATLTRACE(_T("CCOMP::Load"));
  63. return S_OK;
  64. }
  65. STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty)
  66. {
  67. UNREFERENCED_PARAMETER(pStm);
  68. UNREFERENCED_PARAMETER(fClearDirty);
  69. ATLTRACE(_T("CCOMP::Save"));
  70. return S_OK;
  71. }
  72. STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize)
  73. {
  74. UNREFERENCED_PARAMETER(pcbSize);
  75. ATLTRACENOTIMPL(_T("CCOMP::GetSizeMax"));
  76. }
  77. STDMETHOD(InitNew)()
  78. {
  79. ATLTRACE(_T("CCOMP::InitNew\n"));
  80. return S_OK;
  81. }
  82. HRESULT ConnectWithNewSettings(IMsRdpClient* pTS, CConNode* pConNode);
  83. //IExtendContextMenu
  84. STDMETHOD( AddMenuItems )( LPDATAOBJECT , LPCONTEXTMENUCALLBACK , PLONG );
  85. STDMETHOD( Command )( LONG , LPDATAOBJECT );
  86. private:
  87. BOOL OnAddImages( );
  88. BOOL OnHelp( LPDATAOBJECT );
  89. HWND GetMMCMainWindow();
  90. BOOL GiveFocusToControl(IMsRdpClient* pTs);
  91. CCompdata *m_pCompdata;
  92. LPIMAGELIST m_pImageResult;
  93. IConsole *m_pConsole;
  94. BOOL m_bFlag;
  95. OLECHAR m_wszConnectingStatus[MAX_PATH];
  96. OLECHAR m_wszConnectedStatus[MAX_PATH];
  97. OLECHAR m_wszDisconnectedStatus[MAX_PATH];
  98. LPCONSOLEVERB m_pConsoleVerb;
  99. LPDISPLAYHELP m_pDisplayHelp;
  100. //
  101. // Has autoconnection of first
  102. // selected node been triggered
  103. //
  104. BOOL m_bTriggeredFirstAutoConnect;
  105. };
  106. #endif //__COMP_H_