coffeeturtle Posted July 21, 2010 Share Posted July 21, 2010 (edited) How can I convert this VB code to Autoit's _SendMessage function: SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment") I read that when you programmatically change an environment value and want it reflected in new programs that are launched by making the changes in the registry, none of the newly launches applications notice the change. You need to inform all the running applications that the settings have been changed. To do this you send a WM_SETTINGCHANGE message to all the running applications.The logic is to issue a SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment")Alternatively, SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_BLOCK, 100, &output)I just don't know how to convert this commands to work within AutoIt.Thank you so much for any help you can offer! :-) Edited July 21, 2010 by coffeeturtle Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 21, 2010 Share Posted July 21, 2010 Not much of a believer in the search function? Took about 5 seconds to search on WM_SETTINGCHANGE and find a working example. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
coffeeturtle Posted July 21, 2010 Author Share Posted July 21, 2010 Thank you PsaltyDS. I will take a look at this right now. I searched for some time before posting. I usually find exactly what I'm looking for in most cases. This was a case of the wrong search term on my part. I wasted time looking for _SendMessage. I should have thought more outside of the box. Again, thanks. Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 21, 2010 Share Posted July 21, 2010 Usually get the best results searching on the most unique/specific element of what you want. For example, if you want more examples of that DllCall() to Kernel32.dll SetEnvironmentVariable, you'll get thousands of hits from DllCall or Kernel32.dll, but pretty limited hits if you search for SetEnvironmentVariable. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
coffeeturtle Posted July 21, 2010 Author Share Posted July 21, 2010 (edited) Indeed! Thank you for the search tip. I was being bombarded by hits and it was a lot to sort through and many dead ends. I will need to filter better the next time. I hope I can teach myself this new area dealing with Environment Variables and DLL calls rather quickly. Edited July 21, 2010 by coffeeturtle Link to comment Share on other sites More sharing options...
coffeeturtle Posted July 21, 2010 Author Share Posted July 21, 2010 (edited) PsaltyDS,--> It appears that most of what I want to do can be handled by the built-in EnvUpdate function? would you agree? <-- Edited July 21, 2010 by coffeeturtle Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 21, 2010 Share Posted July 21, 2010 EnvUpdate() only updates the run time process of AutoIt itself. The reason for the other broadcasts is to notify other processes that there was a change (which they may or may not have been coded to do anything about). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
coffeeturtle Posted July 21, 2010 Author Share Posted July 21, 2010 Ah! I see. Okay. I see that is the case with EnvSet as well, that it only affects AutoIt, basically. I appreciate your input. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now