IVsPackageDefinedTextMarkerType.GetDefaultColors Method (COLORINDEX[], COLORINDEX[])

 

Returns the default foreground and background colors for a marker.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

int GetDefaultColors(
	COLORINDEX[] piForeground,
	COLORINDEX[] piBackground
)

Parameters

piForeground
Type: Microsoft.VisualStudio.TextManager.Interop.COLORINDEX[]

[out] Pointer to the default foreground color. For a list of piForeground values, see COLORINDEX4C54D3F1-4AEB-497F-8311-2AB027C8BAD8.

piBackground
Type: Microsoft.VisualStudio.TextManager.Interop.COLORINDEX[]

[out] Pointer to the default background color. For a list of piBackground values, see COLORINDEX4C54D3F1-4AEB-497F-8311-2AB027C8BAD8.

Return Value

Type: System.Int32

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

From textmgr.idl:

HRESULT IVsPackageDefinedTextMarkerType::GetDefaultColors(
   [out] COLORINDEX *piForeground, 
   [out] COLORINDEX *piBackground
);

If you specify a value of MV_LINE or MV_BORDER for your marker type, then GetDefaultColors is not called by the environment. Otherwise, this method allows you to specify the default foreground and background coloring that you want to apply to the marked text, based on whether you specified a value of MV_COLOR_ALWAYS or MV_COLOR_LINE_IF_NO_MARGIN. This method only specifies the default color, which the user can change using the Options command on the Tools menu.

System_CAPS_noteNote

The value returned is a COLORINDEX enumeration, not a COLORREF RGB value.

Return to top
Show: