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.

97 lines
4.0 KiB

  1. /*--------------------------------------------------------------------------*
  2. *
  3. * Microsoft Windows
  4. * Copyright (C) Microsoft Corporation, 1999 - 1999
  5. *
  6. * File: tstring.h
  7. *
  8. * Contents: Interface/implementation file for CContextMenuInfo
  9. *
  10. * History: 12-Sep-99 jeffro Created
  11. *
  12. *--------------------------------------------------------------------------*/
  13. #ifndef CMENUINFO_H
  14. #define CMENUINFO_H
  15. #pragma once
  16. class CConsoleView;
  17. class CConsoleTree;
  18. //
  19. // This structure is used to pass UI information to/from the mmc.exe and
  20. // the node manager. It has information about the state of the UI "bits"
  21. // and returns the selected menu item. Note: if the node manager processes
  22. // the menu command, the m_lSelected will be returned with a value of 0
  23. //
  24. enum
  25. {
  26. CMINFO_USE_TEMP_VERB = 0x00000001, // Need for r-click of non-selected scope node and by TaskPads.
  27. CMINFO_SHOW_VIEW_ITEMS = 0x00000002,
  28. CMINFO_SHOW_SAVE_LIST = 0x00000004,
  29. CMINFO_DO_SCOPEPANE_MENU = 0x00000008, // Set when menu invoked from scope pane
  30. CMINFO_SCOPEITEM_IN_RES_PANE = 0x00000010, // set when the item is a scope item in the result pane
  31. CMINFO_SHOW_SCOPEITEM_OPEN = 0x00000020, // Show Open verb for scope item regardless of enable state
  32. CMINFO_FAVORITES_MENU = 0x00000040, // Show items for favorites menu
  33. CMINFO_SHOW_VIEWOWNER_ITEMS = 0x00000080, // Show items for scope item that owns result view
  34. CMINFO_SHOW_SCOPETREE_ITEM = 0x00000100, // Show item for showing/hiding scope tree
  35. };
  36. class CContextMenuInfo
  37. {
  38. public:
  39. POINT m_displayPoint;
  40. // flag to indicate the snap-in manager is allowed to be displayed
  41. bool m_bScopeAllowed; // Display scope pane menu item
  42. bool m_bBackground; // Background on control or item
  43. bool m_bMultiSelect; // TRUE if multi select in the result pane.
  44. bool m_bAllowDefaultItem; // permit a default item on the menu (true for context menus, false for menu bar popups)
  45. MMC_CONTEXT_MENU_TYPES m_eContextMenuType; // Context menu type
  46. DATA_OBJECT_TYPES m_eDataObjectType; // Data object type
  47. HWND m_hWnd; // View HWND
  48. CConsoleView* m_pConsoleView; // console view interface (not a COM interface)
  49. CConsoleTree* m_pConsoleTree; // console tree interface (not a COM interface)
  50. IMMCListViewPtr m_spListView; // Pointer to listview interface (NULL if custom result view)
  51. LPARAM m_resultItemParam; // Our wrapped lparam for the result item
  52. HNODE m_hSelectedScopeNode;
  53. HTREEITEM m_htiRClicked;
  54. int m_iListItemIndex; // The index of the list item in the result pane
  55. DWORD m_dwFlags; // One of the CMINFO_xxx flags
  56. RECT m_rectExclude; // portion of screen to avoid obscuring
  57. public:
  58. CContextMenuInfo ()
  59. {
  60. Initialize();
  61. }
  62. void Initialize ()
  63. {
  64. m_displayPoint.x = 0;
  65. m_displayPoint.y = 0;
  66. m_bScopeAllowed = false;
  67. m_bBackground = false;
  68. m_bMultiSelect = false;
  69. m_bAllowDefaultItem = true;
  70. m_eContextMenuType = MMC_CONTEXT_MENU_DEFAULT;
  71. m_eDataObjectType = CCT_UNINITIALIZED;
  72. m_hWnd = NULL;
  73. m_pConsoleView = NULL;
  74. m_pConsoleTree = NULL;
  75. m_spListView = NULL;
  76. m_resultItemParam = 0;
  77. m_hSelectedScopeNode = 0;
  78. m_htiRClicked = 0;
  79. m_iListItemIndex = 0;
  80. m_dwFlags = 0;
  81. SetRectEmpty (&m_rectExclude);
  82. }
  83. };
  84. #endif /* CMENUINFO_H */