共用方式為


IVsMenuEditor.GetItemRect(IVsMenuItem, RECT[], Int32) Method

Definition

Called to obtain the bounding rectangle for a specific menu item (pmi != NULL) or the bounding rectangle for all currently displayed menu windows (pmi == NULL).

public:
 int GetItemRect(Microsoft::VisualStudio::Shell::Interop::IVsMenuItem ^ pIMI, cli::array <Microsoft::VisualStudio::OLE::Interop::RECT> ^ prc, int fForScrolling);
public:
 int GetItemRect(Microsoft::VisualStudio::Shell::Interop::IVsMenuItem ^ pIMI, Platform::Array <Microsoft::VisualStudio::OLE::Interop::RECT> ^ prc, int fForScrolling);
int GetItemRect(Microsoft::VisualStudio::Shell::Interop::IVsMenuItem const & pIMI, std::Array <Microsoft::VisualStudio::OLE::Interop::RECT> const & prc, int fForScrolling);
public int GetItemRect (Microsoft.VisualStudio.Shell.Interop.IVsMenuItem pIMI, Microsoft.VisualStudio.OLE.Interop.RECT[] prc, int fForScrolling);
abstract member GetItemRect : Microsoft.VisualStudio.Shell.Interop.IVsMenuItem * Microsoft.VisualStudio.OLE.Interop.RECT[] * int -> int
Public Function GetItemRect (pIMI As IVsMenuItem, prc As RECT(), fForScrolling As Integer) As Integer

Parameters

pIMI
IVsMenuItem

[in] The menu item that the bounding rectangle will encompass.

prc
RECT[]

[out] The RECT structure that defines the boundaries of the rectangle.

fForScrolling
Int32

[in] Indicates whether this method is getting an item rectangle for the purpose of scrolling it into view. If true, it is for the purpose of scrolling it into view. In this case, the Designer includes the items Popup rectangle and next item rectangle since these items may not yet be known by the Site, and thus there is no way to obtain their rectangles to make them visible.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

C++

From vsshell.idl:

HRESULT IVsMenuEditor::GetItemRect([in]IVsMenuItem* pIMI, [out]LPRECT prc, [in]BOOL fForScrolling);

Applies to