IVsFontAndColorUtilities.EncodeTrackedItem Method

Returns a RGB (COLORREF) color value corresponding to a color tracked in the Visual Studio environment.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

‘선언
Function EncodeTrackedItem ( _
    iItemToTrack As Integer, _
    aspect As Integer, _
    <OutAttribute> ByRef pcrResult As UInteger _
) As Integer
‘사용 방법
Dim instance As IVsFontAndColorUtilities
Dim iItemToTrack As Integer
Dim aspect As Integer
Dim pcrResult As UInteger
Dim returnValue As Integer

returnValue = instance.EncodeTrackedItem(iItemToTrack, _
    aspect, pcrResult)
int EncodeTrackedItem(
    int iItemToTrack,
    int aspect,
    out uint pcrResult
)
int EncodeTrackedItem(
    [InAttribute] int iItemToTrack, 
    [InAttribute] int aspect, 
    [OutAttribute] unsigned int% pcrResult
)
abstract EncodeTrackedItem : 
        iItemToTrack:int * 
        aspect:int * 
        pcrResult:uint32 byref -> int 
function EncodeTrackedItem(
    iItemToTrack : int, 
    aspect : int, 
    pcrResult : uint
) : int

Parameters

  • iItemToTrack
    Type: System.Int32
    [in] An index indicating a visual component whose color must be tracked.
  • pcrResult
    Type: System.UInt32%
    [out] A COLORREF representation corresponding to the color of the aspect of the tracked visual component.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

The member of the __VSCOLORASPECT enumeration supplied as the aspect argument indicates if the foreground or background color of the tracked item is to be used.

The value of pcrResult returned indicates that the component's color is being tracked and that its value may change.

If aspect has a value of CA_BACKGROUND the COLORREF will have a type of CT_TRACK_BACKGROUND as returned by the GetColorType method.

If aspect has a value of CA_FOREGROUND the COLORREF will have a type of CT_TRACK_FOREGROUND.

Managed code can obtain functionality equivalent to GetSysColor with SystemColors and convert between COLORREF and the System.Drawing.Color structure using M:System.Drawing.ColorTranslator.FromWin32 and M:System.Drawing.ColorTranslator.ToWin32.

.NET Framework Security

See Also

Reference

IVsFontAndColorUtilities Interface

IVsFontAndColorUtilities Members

Microsoft.VisualStudio.Shell.Interop Namespace

Other Resources

Fonts