IVsUIShell2.GetVSSysColorEx Method (Int32, UInt32)
Returns the RGB settings for the specified system color used by the environment.
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
Parameters
- dwSysColIndex
-
Type:
System.Int32
[in] A value from the __VSSYSCOLOREX enumeration specifying the system color to retrieve.
- pdwRGBval
-
Type:
System.UInt32
[out] A 32-bit word containing the RGB value.
Return Value
Type: System.Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
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.