title: How do I use AutoHotkey PostMessage to send WM_WININICHANGE to Program Manager?
body: <p>I've written a <a href="https://superuser.com/questions/403337/autohotkey-script-not-recognizing-windows-explorer">script</a> which updates an environment variable, but I need to tell Program Manager to update the computer's programs with this new information. I was given this as the API call that is made within another program to cause this:</p>
  
  <pre><code>::SendMessage(::FindWindow("Progman", NULL), WM_WININICHANGE, 0L, (LPARAM)"Environment");
  </code></pre>
  
  <p>I am attempting to translate this into an AutoHotKey PostMessage call, but I'm doing something wrong, as it isn't working. Here's where I've gotten so far:</p>
  
  <pre><code>PostMessage, 0x1A,, (LPARAM)"Environment", "Program Manager"
  </code></pre>
  
  <p>Here are the AHK resources I've been looking at to do this:</p>
  
  <p><a href="http://www.autohotkey.com/docs/misc/SendMessageList.htm" rel="nofollow noreferrer">List of Windows Messages</a></p>
  
  <p><a href="http://www.autohotkey.com/docs/misc/SendMessage.htm" rel="nofollow noreferrer">Send Messages to a Window or Its Controls</a></p>
  
  <p><a href="http://www.autohotkey.com/docs/commands/PostMessage.htm" rel="nofollow noreferrer">PostMessage / SendMessage</a></p>
  
  <p>And here are the resources that I used to figure out the original API call:</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx" rel="nofollow noreferrer">SendMessage function</a></p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms725499%28v=vs.85%29.aspx" rel="nofollow noreferrer">WM_WININICHANGE message</a></p>
  
  <p>Can anyone help me figure out what I'm doing wrong?</p>