Re: Force System Variable Reload w/o reboot
From: alpine (alpine_don'tsendspam_at_mvps.org)
Date: 09/10/04
- Next message: alpine: "Re: Standard popup menu behavior"
- Previous message: Steve Coan: "Standard popup menu behavior"
- In reply to: Andrew M: "Re: Force System Variable Reload w/o reboot"
- Next in thread: Andrew M: "Re: Force System Variable Reload w/o reboot"
- Reply: Andrew M: "Re: Force System Variable Reload w/o reboot"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 12:17:34 -0600
If you are launching the VB3 app after setting the new value, you may
want to have a look at the Set Environment example at
http://www.mvps.org/vbvision/
HTH,
Bryan
____________________________________________________________
New Vision Software "When the going gets weird,"
Bryan Stafford "the weird turn pro."
alpine_don'tsendspam@mvps.org Hunter S. Thompson -
Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
On Fri, 10 Sep 2004 11:23:14 -0600, "Andrew M"
<andrewmaxin@hotmail.com> wrote:
>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: alpine: "Re: Standard popup menu behavior"
- Previous message: Steve Coan: "Standard popup menu behavior"
- In reply to: Andrew M: "Re: Force System Variable Reload w/o reboot"
- Next in thread: Andrew M: "Re: Force System Variable Reload w/o reboot"
- Reply: Andrew M: "Re: Force System Variable Reload w/o reboot"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|