次の方法で共有


IVsFontAndColorUtilities.GetEncodedSysColor(UInt32, Int32) Method

Definition

Obtain a System Color service index corresponding to a supplied COLORREF.

public:
 int GetEncodedSysColor(System::UInt32 crSource, [Runtime::InteropServices::Out] int % piSysColor);
int GetEncodedSysColor(unsigned int crSource, [Runtime::InteropServices::Out] int & piSysColor);
public int GetEncodedSysColor (uint crSource, out int piSysColor);
abstract member GetEncodedSysColor : uint32 * int -> int
Public Function GetEncodedSysColor (crSource As UInteger, ByRef piSysColor As Integer) As Integer

Parameters

crSource
UInt32

[in] A COLORREF representation of color value.

piSysColor
Int32

[out] The System Color Service index corresponding the crSource.

Returns

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

Remarks

The COLORREFcrSource used as input must a type of CT_SYSCOLOR as returned by GetColorType.

The value of piSysColor is the same as would be used as an argument to GetSysColor to obtain a COLORREF with the value of crSource.

If an error occurs, the value of piSysColor is undefined.

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.

Applies to