• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 704
  • Last Modified:

How to determine 'Appearance > Color scheme' setting

Hi guys,

I have a VB6 application in which I need to determine 'Color scheme' setting (as per Control Panel > Appearance > Color scheme) so what API, etc. can I use to do that?

/Michael
0
gem56
Asked:
gem56
  • 5
  • 2
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
check the code snippet.
change the scheme name to your favorite.
Module Module1
    Declare Function DeskSetCurrentScheme Lib "desk.cpl" (ByVal SchemeName As String) As Long

    Sub Main()
        Dim res As Long = DeskSetCurrentScheme("Windows Classic")

    End Sub

End Module

Open in new window

0
 
Meir RivkinFull stack Software EngineerCommented:
return 1 means success, returns 0 means failure.
0
 
Meir RivkinFull stack Software EngineerCommented:
FYI, list of available color schemes  can be found in the registry here:
HKEY_CURRENT_USER\Control Panel\Appearance\Schemes
see screenshot1.

to get the display name which reflect each scheme id, goto:
HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache
see screenshot2

screenshot1.jpg
screenshot2.jpg
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
gem56Author Commented:
Thanks a lot for that sedgwick and I will most likely also use that API but for now I need to find out the current setting so is there an equivelant "DeskGetCurrentScheme" API?

I used Google
0
 
Meir RivkinFull stack Software EngineerCommented:
u need to check the HKEY_CURRENT_USER\Control Panel\Appearance - Current value.
the value should be one of available schemes listed in screenshot2.
for example:  @themeui.dll,-855

0
 
Meir RivkinFull stack Software EngineerCommented:
so basically is using the following code:
        {
            string currentScheme = Registry.GetValue(@"HKEY_CURRENT_USER\Control Panel\Appearance", "Current", null).ToString();
            string schemeName = Registry.GetValue(@"HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache", currentScheme, null).ToString();
0
 
gem56Author Commented:
Thanks a lot sedgwick.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now