Link to home
Start Free TrialLog in
Avatar of OTveit
OTveit

asked on

Changing the system palette in Windows NT

I'm developing an application which needs a "Night Display". The "Night Display" should be able to change the colors for every application in Windows NT (including Desktop, Mouse Icon, Taskbar....) I could change the color of every single object, but that is not satisfactory. The functionality I'm looking for is very much like the functionality in the Control Panel. I need to be able to change the Scheme and colors for every item. Preferably I would like to be able to save/read these settings on/from a file.
Avatar of nIcebear
nIcebear

I'm sure the colors are stored in the Registry. Export your registry (eg. into before.reg), change the colors and export it again (eg. into after.reg). Look up, which values are changing (eg. with WinDiff - thats a free tool from Microsoft coming with Win98). If you know which values to change you can write them into the registry.

PS: There's surely a better method to do this with some API-call (which I do not know).
Check out these microsoft KB articles:

How to Set Windows System Colors Using API and Visual Basic
http://support.microsoft.com/support/kb/articles/Q82/1/58.ASP 
 
HOWTO: Use Custom System Colors Only When Your App Has Focus
http://support.microsoft.com/support/kb/articles/Q186/0/62.ASP?LNG=ENG&SA=MSDN 
 

The article "How to Set Windows System Colors Using API and Visual Basic" is a VB3 example, but it still works in VB5/VB6... All you have to do is use the 32-BIT API calls instead of the 16-BIT called in the example...


Cheers!

Avatar of OTveit

ASKER

I tried using SetSysColor and GetSysColor, but it does not quite satisfy my needs.

Problem 1: I can't get GetSysColor to work properly. It always returns 0.

Problem 2: I can't change the color of the mouse icon.
You can't change the color of the mouse pointer - to do this you would have to load a new .cur file made witht he colours you want...

As for prob 1 I have not had any problems with NT4, Win2k, and Win9x (I have access to all these - great for testing)
ASKER CERTIFIED SOLUTION
Avatar of Ruchi
Ruchi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of OTveit

ASKER

I still don't know how to change the color of the mouse pointer. I understand that I need to load a different .cur file but how can I do this so it takes effect immediately for the hole system? If I set the Mouse Pointer property to Custom, and loads a .cur file, it only works for that specific form (also not for the title bar). If I change the cursor file in the Registry (I haven't got this to work yet) I guess this won't take effect until I reboot....?
the mouse pointer can be changed using the API (can't remember right now) which will make a system-wide change to the cursor (just like you changed them in the Mouse control panel applet)