troubleshooting Question

Publish that Environment Variables have been updated

Avatar of TheFlyingCorpse
TheFlyingCorpseFlag for Norway asked on
.NET ProgrammingC#Windows XP
4 Comments1 Solution458 ViewsLast Modified:
Hi,

I am using SETX from Microsoft's Support Tools to set Environment Variables during logon. Another process I have needs the information from those Environment Variables I have set.

AFAIK SETX does not do the SendMessage function to notify applications that there is an update to Environment Variables, and I've been looking for ways to do this since browsing the internet does not yield simple applications that just invoke this function and then end.


I've found a C# sample on how to import the user32.dll which has this function, but not what code I need to use to invoke the SendMessage function.

Hints or samples of what I need to enclose this to a working program would be awsome ;)

[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
ASKER CERTIFIED SOLUTION
Dennis Aries
CEO

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros