All Forums
 Microsoft Windows CE
 CE Sample Applications and Utilities
 eVC - SetColorScheme
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 15 Sep 2003 :  14:48:11  Show Profile  Email Poster
SetColorScheme


This application loads the UI color scheme information from the registry and applies it to the current desktop. This is only necessary for platforms whose shell does not do so automatically.

Key APIs Used

RegOpenKeyEx,
RegQueryValueEx,
SetSysColors
Lines of Code: ~150

Source Download

Rev 2 - Nov. 16, 2004 (6k zip).


Edited by ctacke 16-Nov-2004: Update release

ctacke

877 Posts

Posted - 16 Nov 2004 :  11:31:45  Show Profile  Email Poster
Bug Fix

Revision 1 of this app failed if the "Display Name" of the Scheme didn't match the subkey name of the scheme in the registry, such as for 'Windows Standard' or 'High Impact White'. Revision 2 fixes that bug.
Go to Top of Page

ken.yeung

20 Posts

Posted - 21 Apr 2005 :  22:09:22  Show Profile  Email Poster
I am working on WinCE v4.20.9 with AGX and VB.Net. I tried to swap the system color of Desktop and that of active caption text (white) using the following code. However, even the intSuccess returns -1 (nonzero means success), the colors did not change.

Also, I am not able to call GetSysColor to obtain the system color. It always return zero (means failure) and using GetLastError() gives 87 (invalid parameter).

Please kindly advise on the use of GetSysColor and SetSysColrs.

Thanks,
Ken.

*************** CODE ****************************
Overloads Declare Function GetSysColor Lib "coredll" (ByVal nIndex As Integer) As Integer

Overloads Declare Function SetSysColors Lib "coredll" (ByVal cElements As Integer, _
ByVal lpaElements As Integer(), _
ByVal lpaRgbValues As Integer()) As Boolean


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim intTextColor As Integer = Label1.ForeColor.ToArgb
Dim intBkgdColor As Integer = Me.BackColor.ToArgb

Dim intElements() As Integer = {COLOR_CAPTIONTEXT, COLOR_DESKTOP}
Dim intRgbValues() As Integer = {intBkgdColor, intTextColor}

Dim intSuccess As Integer = SetSysColors(2, intElements, intRgbValues)

Me.Refresh()
End Sub
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000