IVsFontAndColorUtilities::EncodeTrackedItem Method (Int32, Int32, UInt32)
Returns a RGB (COLORREF) color value corresponding to a color tracked in the Visual Studio environment.
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
int EncodeTrackedItem( int iItemToTrack, int aspect, [OutAttribute] unsigned int% pcrResult )
Parameters
- iItemToTrack
-
Type:
System::Int32
[in] An index indicating a visual component whose color must be tracked.
- aspect
-
Type:
System::Int32
[in] A member of the __VSCOLORASPECT enumeration.
- pcrResult
-
Type:
System::UInt32
[out] A COLORREF representation corresponding to the color of the aspect of the tracked visual component.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
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.