Solved

Refreshing Windows

Posted on 2004-10-03
8
170 Views
Last Modified: 2010-05-02
So I made this program called XP Edit, anywho I have a minor problem with it. Basically what the program does is, it's like a replacement for TweakUI, only my problem is before any changes are applied, you have to log off then log on. I want it to apply the changes right away, so I would assume the best way to do that would be to end explorer.exe and then re-launch explorer.exe, so my question is how do I do that?
0
Comment
Question by:Captain_Obvious
  • 2
  • 2
8 Comments
 
LVL 12

Expert Comment

by:jkaios
ID: 12216328
You have to use some sort of "Nofity..." API calls to inform the OS of the change.
0
 

Author Comment

by:Captain_Obvious
ID: 12231340
That's a very vague description... could someone else help a little?
0
 

Accepted Solution

by:
prodesign777 earned 300 total points
ID: 12259357
This should work for you:

Public Declare Function NotifyChangeEventLog Lib "advapi32" Alias "NotifyChangeEventLog" (ByVal hEventLog As Long, ByVal hEvent As Long) As Long


Hope this helps you, good luck :)
0
 

Author Comment

by:Captain_Obvious
ID: 12262570
Thanks, that's a big help. Only one further question :D kinda funny really how do I call it. I put it in a module but when I call it, I get some errors. Could you just help me out with that? Thanks a bunch!
0
 

Expert Comment

by:prodesign777
ID: 12635755
Sorry, I was on vacation. Now here is how you do it.
First include a new module in your project. In the module put the following code:

Public Declare Function NotifyChangeEventLog Lib "advapi32" Alias "NotifyChangeEventLog" (ByVal hEventLog As Long, ByVal hEvent As Long) As Long

Then where ever you want the notifychangeeventlog api call to be called from for instance a button click event put the following code:

Dim a As Long
Dim b As Long
NotifyChangeEventLog a, b

And that's all. Have fun with it my friend :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

740 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