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.

86 lines
3.0 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to existing Microsoft documentation.
  4. //
  5. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  6. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  7. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  8. // PURPOSE.
  9. //
  10. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  11. //
  12. //==============================================================;
  13. #ifndef _SNAPINBASE_H
  14. #define _SNAPINBASE_H
  15. #include "DeleBase.h"
  16. class CStaticNode : public CDelegationBase {
  17. public:
  18. CStaticNode();
  19. virtual ~CStaticNode();
  20. virtual const _TCHAR *GetDisplayName(int nCol = 0);
  21. virtual const GUID & getNodeType() { return thisGuid; }
  22. virtual const int GetBitmapIndex() { return INDEX_NONE; }
  23. virtual const _TCHAR *GetMachineName() { return getHost(); }
  24. public:
  25. // virtual functions go here (for MMCN_*)
  26. virtual HRESULT OnExpand(IConsoleNameSpace2 *pConsoleNameSpace2, IConsole *pConsole, HSCOPEITEM parent);
  27. virtual HRESULT OnRemoveChildren();
  28. virtual HRESULT CreatePropertyPages(IPropertySheetCallback *lpProvider, LONG_PTR handle);
  29. virtual HRESULT HasPropertySheets();
  30. virtual HRESULT GetWatermarks(HBITMAP *lphWatermark,
  31. HBITMAP *lphHeader,
  32. HPALETTE *lphPalette,
  33. BOOL *bStretch);
  34. virtual HRESULT OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed);
  35. virtual HRESULT OnMenuCommand(IConsole *pConsole, IConsoleNameSpace2 *pConsoleNameSpace2, long lCommandID, IDataObject *piDataObject);
  36. private:
  37. enum { IDM_SELECT_COMPUTER = 4 };
  38. enum { NUMBER_OF_CHILDREN = 1 };
  39. CDelegationBase *children[NUMBER_OF_CHILDREN];
  40. // {39874FE4-258D-46f2-B442-0EA0DA2CBEF8}
  41. static const GUID thisGuid;
  42. struct privateData {
  43. _TCHAR m_host[MAX_PATH];
  44. BOOL m_fIsRadioLocalMachine;
  45. BOOL m_fAllowOverrideMachineNameOut;
  46. bool m_isDirty;
  47. privateData() : m_isDirty(false) {
  48. ZeroMemory(m_host, sizeof(m_host));
  49. m_fIsRadioLocalMachine = TRUE;
  50. m_fAllowOverrideMachineNameOut = FALSE;
  51. }
  52. } snapInData;
  53. static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  54. static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  55. static GetLocalComputerName( _TCHAR *szComputerName);
  56. HRESULT ReinsertChildNodes(IConsole *pConsole, IConsoleNameSpace2 *pConsoleNameSpace2);
  57. public:
  58. LONG getDataSize() { return sizeof(privateData); }
  59. void *getData() { return &snapInData; }
  60. bool isDirty() { return snapInData.m_isDirty; }
  61. void clearDirty() { snapInData.m_isDirty = false; };
  62. _TCHAR *getHost() { return snapInData.m_host; }
  63. };
  64. #endif // _SNAPINBASE_H