Solved

Refreshing Windows

Posted on 2004-10-03
8
168 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

831 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