Click to See Complete Forum and Search --> : Enviroment Variables


Nabeel Khan
September 25th, 2001, 03:41 AM
Hi Everyone,

I have wrote a routine in VB to set the enviroment variables using Windows API's . It is running fine and it is adding evironment variables, but the problems is that it takes me to reboot or log off to make the actual settings takes place..

Is there any code or technique by which i can avoid rebooting or logging off ?


Regards

Nabeel

Clearcode
September 25th, 2001, 04:14 AM
The problem here is that every thread takes a local copy of the environment variables at startup and doesn't neccesarily update them until restarted.

Well written programs should refresh their environment variables if you send them a WM_WININICHANGE message though - try sending this to HWND_BROADCAST to see if that has any affect.

HTH,
Duncan

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.