Solved

Refreshing Windows

Posted on 2004-10-03
8
164 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
Comment Utility
You have to use some sort of "Nofity..." API calls to inform the OS of the change.
0
 

Author Comment

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

Accepted Solution

by:
prodesign777 earned 300 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now