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

x
?
Solved

Update Windows

Posted on 1999-07-26
3
Medium Priority
?
134 Views
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.
0
Comment
Question by:microfleet
[X]
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
3 Comments
 
LVL 12

Expert Comment

by:mark2150
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>.

M

0
 
LVL 10

Accepted Solution

by:
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

  i=FindWindowEx(FindWindowEx(FindWindow("Progman","Program
Manager"),0,"SHELLDLL_DefView",""),0,"SysListView32","")
  call PostMessage(i,WM_KEYDOWN,VK_F5,0)
  call PostMessage(i,WM_KEYUP,VK_F5, 2^31)
end sub

This should do it...

..-=ViKtOr=-..
0
 

Author Comment

by:microfleet
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!
0

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