How To Propagate Environment Variables to the System
This post is really a bookmark for me because I regularly seem to come back to the question of wanting to update environment variables and trying to remember the windows message to use to propagate the changes. There is a knowledge base article that covers this, and the message to broadcast is WM_SETTINGCHANGE.