Sign in to follow this  
Followers 0
xrxca

Post Windows Message (How?)

4 posts in this topic

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

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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_SETTINGCHANGE

other info...

http://msdn.microsoft.com/library/default....TTINGCHANGE.asp

Edit typo

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

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_SETTINGCHANGE

other info...

http://msdn.microsoft.com/library/default....TTINGCHANGE.asp

So 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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0