Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: system colors
It is somewhat more complicated to change the system colors for the current session. The code below shows how to do both.
;Note: This code only seems to work when in Windows Classic view mode. It doesn't seem to ;work in XP theme view mode. element_string = "ActiveTitle"; From registry dataitem name element_offset = 2; Code from table below color_red = 255; red color value 0 to 255 color_green = 0; green color value 0 to 255 color_blue = 0; blue color value 0 to 255 ;--------------------------------------- ; This code sets the colors for the next restart. Easy RegSetValue(@REGCURRENT, "Control Panel\Colors\[%element_string%]", "%color_red% %color_green% %color_blue%") ; End of Next Restart code. ;This code sets the colors for the current session elements_buf = binaryalloc(4) values_buf = binaryalloc(4) BinaryPoke4(elements_buf, 0, element_offset) BinaryPoke4(values_buf, 0, color_red | (color_green << 8) | (color_blue << 16)) DaDll=strcat(DirWindows(1),"USER32.DLL") DllCall(DaDll, long:"SetSysColors", word:1, lpbinary:elements_buf, lpbinary:values_buf) BinaryFree(elements_buf) BinaryFree(values_buf) exit ;End of current session code exit ;;;;; ;Color offsets: ; 0 COLOR_SCROLLBAR ; 1 COLOR_BACKGROUND ; 2 COLOR_ACTIVECAPTION ; 3 COLOR_INACTIVECAPTION ; 4 COLOR_MENU ; 5 COLOR_WINDOW ; 6 COLOR_WINDOWFRAME ; 7 COLOR_MENUTEXT ; 8 COLOR_WINDOWTEXT ; 9 COLOR_CAPTIONTEXT ;10 COLOR_ACTIVEBORDER ;11 COLOR_INACTIVEBORDER ;12 COLOR_APPWORKSPACE ;13 COLOR_HIGHLIGHT ;14 COLOR_HIGHLIGHTTEXT ;15 COLOR_BTNFACE ;16 COLOR_BTNSHADOW ;17 COLOR_GRAYTEXT ;18 COLOR_BTNTEXT ;19 COLOR_INACTIVECAPTIONTEXT ;20 COLOR_BTNHIGHLIGHT ;21 COLOR_3DDKSHADOW ;22 COLOR_3DLIGHT ;23 COLOR_INFOTEXT ;24 COLOR_INFOBK
Note: the above code works fine if you have the desktop set to windows classic. It will change the background in XP style but
this is masked by any wallpaper or open window. The magic of changing system colors in windows classic is that the windows
title bars change color as well. In XP this does not happen.
I am trying to find a way of showing users which environment they are in which remains visible at all times without taking
up too much room. I could resort to a status bar display but this adds clutter to an already crowded area.
It basically suggests you create and install your own theme files. Please refer this MSDN document for the information:
And for the visual style, please refer this page:
Article ID: W13209
Filename: Change System Colors.txt
File Created: 2005:01:27:08:55:04
Last Updated: 2005:01:27:08:55:04