In my application, I wish to set a system environment variable and have it
take affect for other processes. I read in MSDN help that to set a system
environment variable, I add the new value to the registry and broadcast a
WM_SETTINGCHANGE message. The registry change worked, but the broadcast did
not. When I open a new console I cannot see the new environment variable. My
call to broadcast the message was:
BroadcastSystemMessage(BSF_FORCEIFHUNG,
BSM_ALLCOMPONENTS,
WM_SETTINGCHANGE,
NULL,
NULL);
My test was to run my app that adds the new system variable, then open a new
command prompt and see if the new variable is there. I found that it was
indeed added to the correct place in the registry, but the broadcast did not
work. Does anybody know what I am doing wrong?
Thank you - Bob Sanford, HP, Houston, TX