Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Update Windows

Posted on 1999-07-26
Medium Priority
Last Modified: 2010-04-30
I want to change the Windows system colors from within my program, but I can't get Windows to update itself to acknowledge the changes.
Question by:microfleet
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 12

Expert Comment

ID: 1527568
Ummm, I think I know this one. You have to kill and restart Explorer as I recall. The colors and other screen settings are read at initial load and not subsequiently. This forces a re-read of the registry without requiring a full stop. When you tell explorer to terminate it will fire the <Stop>/<Restart>/<Cancel> dialog, Select <Cancel> and Explorer will die & autorestart without closing the machine. I've never tried to do that programmatically, but it should work. It works if you <End Task> from <Ctrl/Alt/Del>.


LVL 10

Accepted Solution

viktornet earned 400 total points
ID: 1527569
use the SetSysColors() function to change those colors.... then try calling the following sub..

sub RefreshDesktop()
  dim i as long

  call PostMessage(i,WM_KEYDOWN,VK_F5,0)
  call PostMessage(i,WM_KEYUP,VK_F5, 2^31)
end sub

This should do it...


Author Comment

ID: 1527570
Thanks viktornet, the SetSysColor did the trick all on its own. I couldnt be happier. You get the points for simply pointing out that function. I havent tried the RefreshDesktop procedure yet, but I have no doubt it will work.

Thanks again!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question