Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than coredll, prefix the name with the module name and a period.
SetSysColors (coredll)
coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for SetSysColors in other DLLs exists, click on Find References to the right.
.
C# Signature:
[DllImport("coredll.dll")]
static extern int SetSysColors(int cElements, Int32[] lpaElements, Int32[] lpaRgbValues);
VB Signature:
<DllImport("Coredll.dll")> _
Public Shared Function SetSysColors(ByVal cElements As Integer, ByRef lpaElements As Integer(), ByRef lpaRgbValues As Integer()) As Integer
{
/// <summary>
/// SetSysColors: Importierte Methode aus der CoreDll.dll
/// Registry Order System color Description
/// 0 COLOR_SCROLLBAR Color of the gray area of a scroll bar.
/// 1 COLOR_BACKGROUND Background color of the desktop window.
/// 2 COLOR_ACTIVECAPTION Color of the title bar of an active window.
/// 3 COLOR_INACTIVECAPTION Color of the title bar of an inactive window.
/// 4 COLOR_MENU Background color of a menu.
/// 5 COLOR_WINDOW Background color of a window.
/// 6 COLOR_WINDOWFRAME Color of a window frame.
/// 7 COLOR_MENUTEXT Color of the text in a menu.
/// 8 COLOR_WINDOWTEXT Color of the text in a window.
/// 9 COLOR_CAPTIONTEXT Color of the text in a title bar and of the size box and scroll bar arrow box.
/// 10 COLOR_ACTIVEBORDER Color of the border of an active window.
/// 11 COLOR_INACTIVEBORDER Color of the border of an inactive window.
/// 12 COLOR_APPWORKSPACE Background color of multiple document interface (MDI) applications.
/// 13 COLOR_HIGHLIGHT Color of an item selected in a control.
/// 14 COLOR_HIGHLIGHTTEXT Color of the text of an item selected in a control.
/// 15 COLOR_BTNFACE Color of the face of a button.
/// 16 COLOR_BTNSHADOW Shadow color of buttons for edges that face away from the light source.
/// 17 COLOR_GRAYTEXT Color of shaded text. This color is set to 0 if the current display driver does not support a solid gray color.
/// 18 COLOR_BTNTEXT Color of the text for push buttons.
/// 19 COLOR_INACTIVECAPTIONTEXT Color of the text in the title bar of an inactive window.
/// 20 COLOR_BTNHIGHLIGHT Highlight color of buttons for edges that face the light source.
/// 21 COLOR_3DDKSHADOW Color of the dark shadow for three-dimensional display elements.
/// 22 COLOR_3DLIGHT Highlight color of three-dimensional display elements for edges that face the light source.
/// 23 COLOR_INFOTEXT Color of the text for ToolTip controls.
/// 24 COLOR_INFOBK Background color for ToolTip controls.
/// 25 COLOR_STATIC Background color for static controls and dialog boxes. Supported in Windows CE 2.0 and later.
/// 26 COLOR_STATICTEXT Color of the text for static controls. Supported in Windows CE 2.0 and later.
/// 27 COLOR_GRADIENTACTIVECAPTION Color of the title bar of an active window that is filled with a color gradient.
/// 28 COLOR_GRADIENTINACTIVECAPTION Color of the title bar of an inactive window that is filled with a color gradient.
/// </summary>
/// <param name="cElements"></param>
/// <param name="lpaElements"></param>
/// <param name="lpaRgbValues"></param>
/// <returns></returns>
private const int SYS_COLOR_INDEX_FLAG = 0x40000000;
public const int COLOR_SCROLLBAR = (0 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_BACKGROUND = (1 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_ACTIVECAPTION = (2 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_INACTIVECAPTION = (3 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_MENU = (4 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_WINDOW = (5 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_WINDOWFRAME = (6 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_MENUTEXT = (7 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_WINDOWTEXT = (8 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_CAPTIONTEXT = (9 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_ACTIVEBORDER = (10 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_INACTIVEBORDER = (11 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_APPWORKSPACE = (12 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_HIGHLIGHT = (13 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_HIGHLIGHTTEXT = (14 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_BTNFACE = (15 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_BTNSHADOW = (16 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_GRAYTEXT = (17 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_BTNTEXT = (18 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_INACTIVECAPTIONTEXT = (19 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_BTNHIGHLIGHT = (20 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_3DDKSHADOW = (21 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_3DLIGHT = (22 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_INFOTEXT = (23 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_INFOBK = (24 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_STATIC = (25 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_STATICTEXT = (26 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_GRADIENTACTIVECAPTION = (27 | SYS_COLOR_INDEX_FLAG);
public const int COLOR_GRADIENTINACTIVECAPTION = (28 | SYS_COLOR_INDEX_FLAG);
if (retVel == false)
{
int error = Marshal.GetLastWin32Error();
throw new Exception(string.Format("SetSysColors() returned {0}!", error));
}
}
}
ByVal is a VB keyword that specifies a variable to be passed as a parameter BY VALUE. In other words, if the function or sub changes the value of the internal variable, it does not change the value of the external variable that was passed to it.
4/25/2007 3:19:55 AM - josep1er@cmich.edu-141.209.229.179
ByRef is a VB keyword that specifies a variable to be passed as a parameter BY REFERENCE. In other words, the pointer to the variable is passed and any change to its value made within the function or sub will change its value outside the function/sub.
4/25/2007 3:19:29 AM - anonymous
ByRef is a VB keyword that specifies a variable to be passed as a parameter BY REFERENCE. In other words, the pointer to the variable is passed and any change to its value made within the function or sub will change its value outside the function/sub.
4/25/2007 3:19:29 AM - anonymous
The GetSysColor API
1/26/2011 5:32:41 AM - -155.104.37.17
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).