473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

BroadcastSystemMessage and System Environment Variables

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

Jun 14 '07 #1
0 1166

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
3
by: Jim Potts | last post by:
What is the best way in Python version 2.x to read/get Windows (nt/2000/xp) system and user environment variables? Thanks for the help! jep
2
by: could ildg | last post by:
To a environment variable in Windows, can python know if it is a system environment variable or a current-user environment variable? -- ðÐðÄ´ÏÃ÷¾ø¶¥¡¢¸ãЦ֮¼«£¬ÊÇÈËÀàµÄºÃÅóÓÑ¡£...
4
by: A Pham | last post by:
Hi, We have a C++ project written in Visual Studio 6 and we try to compile it in VS 2003 standard version but it gives an error Unknown Identifier on the call of BroadcastSystemMessage. The VS...
1
by: darrel | last post by:
We've purchased a component that requires us to install two DLLs. One we add as a reference to our project, but the otherone we have to add to the 'environment setup' as a system path reference....
2
by: Sean Campbell | last post by:
Hello all! I have been looking in the Framework documentation for an answer and it has not shown itself. Could someone tell me if it is possible with VB or C# to add and modify Windows System...
1
by: pagates | last post by:
Hi All, What's the "best" way to get System Environment Variables (VS2003)? Environment.GetEnvironmentVariable("xxx") only gets user Environment variables. Thanks, pagates
5
by: Henaro | last post by:
Hello~ I am having trouble setting environment variables in C++ on win32. The code that is not working is: char prxy; char pf_cmd1 = "set http_proxy="; ....
3
by: smitty1e | last post by:
Just a fun exercise to unify some of the major input methods for a script into a single dictionary. Here is the output, given a gr.conf file in the same directory with the contents stated below: ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.