xrxca Posted December 27, 2005 Share Posted December 27, 2005 So maybe I'm blind, but I can't see any way to post a message from an AutoIT script, I'm working on a script to automate an upgrade across a number of machines across the country, and need to be able to post the windows message WM_SETTINGCHANGE. The patch being put in (NOT MINE, I'd never write anything this idiotic) fails creatively if a couple user system settings are not set just right, and doesn't look at the registry for those settings, so if I make the change to the registry to force the correct settings, the patch doesn't see the change and fails. A WM_SETTINGCHANGE message posted to HWnd 0 after the registry change gets around this problem. Another way around it would be to force a logoff, but there is no guarantee the same user would log back on, and it would have to be done twice, once to allow the patch to run in it's narrow idea of what the system should be, and again to reset the user settings to their original state. I suppose I could just write a quick program in something else that would take HWnd, Msg, wParam and lParam on the command line and call it from autoit to post the message, but it would be cleaner to be able to do it from within AutoIT, and it would be one less file to distribute. By far, the worst four letter word (swear word) out there has to be USER Link to comment Share on other sites More sharing options...
Valik Posted December 27, 2005 Share Posted December 27, 2005 EnvUpdate() broadcasts a WM_SETTINGCHANGE I believe. If that isn't sufficient, then DllCall() can be used on the Windows API function SendMessage() to send the message. Link to comment Share on other sites More sharing options...
herewasplato Posted December 27, 2005 Share Posted December 27, 2005 (edited) ... need to be able to post the windows message WM_SETTINGCHANGE...Take a look at how DllCall was used in this thread:http://www.autoitscript.com/forum/index.php?showtopic=15343...or search the forum for other posts about WM_SETTINGCHANGEother info...http://msdn.microsoft.com/library/default....TTINGCHANGE.aspEdit typo Edited December 28, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
xrxca Posted December 28, 2005 Author Share Posted December 28, 2005 Take at how DllCall was used in this thread:http://www.autoitscript.com/forum/index.php?showtopic=15343...or search the forum for other posts about WM_SETTINGCHANGEother info...http://msdn.microsoft.com/library/default....TTINGCHANGE.aspSo I was blind after all, Envupdate didn't do it, but DllCall did (Created a wrapper for PostMessage, as I can see needing this in the future) I never even thought to search specifically for WM_SETTINGCHANGE, and searched for "Post Message", and "Send Message" instead of PostMessage and SendMessage resulting in a horrid signal to noise ratio, simply my own stupidity (I'll go with the holiday hangover excuse).Thanks By far, the worst four letter word (swear word) out there has to be USER 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