Re: Force System Variable Reload w/o reboot
From: Andrew M (andrewmaxin_at_hotmail.com)
Date: 09/10/04
- Next message: Steve Coan: "Standard popup menu behavior"
- Previous message: Ken Halter: "Re: Show/Hide file extension showin open/save dialogbox"
- In reply to: Bob Butler: "Re: Force System Variable Reload w/o reboot"
- Next in thread: alpine: "Re: Force System Variable Reload w/o reboot"
- Reply: alpine: "Re: Force System Variable Reload w/o reboot"
- Reply: Bob Butler: "Re: Force System Variable Reload w/o reboot"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 11:23:14 -0600
Bob
Thank you for your reply. I tried you code but regretably, it did not
work. I am trying to set an environment variable that is read by a legacy
VB3 application that uses the VB "Environ$" method. Although the Windows
Environment Variables Dialog respects the change, this variable does not.
what I need is an API that mimics loading the environment variables from the
registry as it does on startup. If there is another place (in memory or on
disk) that this value is being stored, that would work too.
Andrew
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:O9d4wN1lEHA.644@tk2msftngp13.phx.gbl...
> "Andrew M" <andrewmaxin@hotmail.com> wrote in message
> news:10k3kqnetq75la2@corp.supernews.com
>> Hello
>>
>> I am trying to reset a custom system-level environment variable
>> for an application. I am having an issue with syncronization of the
>> changes. Is there a way to force windows (Win98 and up) to reload
>> that variable from the registry w/o having to reboot?
>
> try this
>
> Private Const HWND_BROADCAST = -1
> Private Const WM_WININICHANGE = &H1A
> Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
> (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
> ByRef lParam As Any) As Long
>
> Dim x As Long
> x = SendMessage(HWND_BROADCAST, WM_WININICHANGE, 1, ByVal 0&)
>
> not all apps recognize this so some things will not pick up the new
> environment variable setting but the explorer shell should
>
- Next message: Steve Coan: "Standard popup menu behavior"
- Previous message: Ken Halter: "Re: Show/Hide file extension showin open/save dialogbox"
- In reply to: Bob Butler: "Re: Force System Variable Reload w/o reboot"
- Next in thread: alpine: "Re: Force System Variable Reload w/o reboot"
- Reply: alpine: "Re: Force System Variable Reload w/o reboot"
- Reply: Bob Butler: "Re: Force System Variable Reload w/o reboot"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|