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
Solved

Refreshing Windows

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library 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…
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…

839 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