Freigeben über


IVsUIShell2.GetVSSysColorEx(Int32, UInt32) Method

Definition

Returns the RGB settings for the specified system color used by the environment.

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

Parameters

dwSysColIndex
Int32

[in] A value from the __VSSYSCOLOREX enumeration specifying the system color to retrieve.

pdwRGBval
UInt32

[out] A 32-bit word containing the RGB value.

Returns

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

Remarks

COM Signature

From vsshell80.idl:

HRESULT IVsUIShell2::GetVSSysColorEx(  
   [in]  VSSYSCOLOREX  dwSysColIndex,  
   [out] DWORD        *pdwRGBval  
);  

This method supersedes the GetVSSysColor method.

This method is analogous to the Win32 API GetSysColor function and returns the RGB settings for the various system colors used by Visual Studio. These values change depending upon the implemented Windows desktop scheme.

The RGB value returned by the GetVSSysColorEx method is a 32-bit, Windows color value in the format of a COLORREF value.

C++ code can directly use the returned RGB value by using the macros that support COLORREFs, such as GetRValue, GetGValue and GetBValue.

Managed code that uses returned colors can use the T:System.Drawing.Color structure, which can be obtained from the 32-bit Windows color value by using the M:System.Drawing.ColorTranslator.FromWin32(System.Int32) method.

For a full discussion on best practices for choosing the correct color values when designing a user interface, see The Visual Studio UI Guidelines document.

Applies to