Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

A way to broadcast a WM_SETTINGCHANGE message?


  • Please log in to reply
10 replies to this topic
Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
I'd like a way to do this with AutoHotkey, so far using WinHide/WinShow/WinSet,Redraw doesn't reliably force the desktop and taskbar to update/redraw when changes have been made - for example showing/hiding of icons on the desktop, and altering some of the window styles for the taskbar. From looking at some VB code it looks like this message is used to update when changes have been made. I think it would be useful to have an AutoHotkey command for this since it seems so central to Windows.
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

  • Guests
  • Last active:
  • Joined: --
You mean like this (from the help file)?

To send a message to all windows in the system, including those that are hidden or disabled, specify ahk_id 0xFFFF for WinTitle (0xFFFF is HWND_BROADCAST). This technique should be used only for messages intended to be broadcast, such as the following example:

SendMessage, 0x1A,,,, ahk_id 0xFFFF ; 0x1A is WM_SETTINGCHANGE

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
Thanks, someone had posted that in the topic I linked, I didn't realise it was in the help file. Unfortunately this doesn't work either. :(
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
Perhaps EnvUpdate can do that.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
Thanks Decarlo110. EnvUpdate and SendMessage, 0x1A,,,, ahk_id 0xFFFF seem to refresh the gui, which works for the taskbar, but not for the desktop icons. I had hoped broadcasting WM_SETTINGCHANGE would be the answer.
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
Hi, Serenity.

Solution:
^#!m::
Loop 6
{
	sleep 50
	if not GetKeyState("m", "p")
	{
		if iconsHidden
		{
			Control, Show, , SysListView321, Program Manager
			iconsHidden =
			RETURN
		}
		else
		{
			Control, Hide, , SysListView321, Program Manager
			iconsHidden = 1
			RETURN
		}
	}
	if A_Index = 6
		ControlSend, SysListView321, {F5}, Program Manager
}
KeyWait m
return

Normal press duration will toggle hiding of the desktop icons.
Pressing the hotkey for 0.3 sec will refresh the desktop (the icons and background, not any [other] windows).
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
Thanks, unfortunately your script doesn't work for me. :(

I've been going over and over what happens when the desktop is refreshed with Winspector and there is no WM_COMMAND to refresh the desktop. Instead the Internet Explorer_Server control is destroyed and recreated. I am wondering if it is possible to do this with PostMessage and DllCall combined.
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

Decarlo110
  • Members
  • 303 posts
  • Last active: Feb 12 2006 02:15 AM
  • Joined: 15 Dec 2004
What program are you using to display your desktop background?

When i checked your website, i think it had some screenshots of non-standard desktops.
1) The Open Source Definition http://www.opensourc...ition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <>

kapege.de
  • Members
  • 192 posts
  • Last active: Jan 16 2012 12:34 PM
  • Joined: 07 Feb 2005
Another method (working sample):
F2::
send, #d ; Shows the desktop
MouseClick, Left, 50, 20 ; activates the desktop by clicking the top-left icon
send, {F5} ; refreshes the desktop
send, +#m ; reactivates the windows
return

Peter

Wisenheiming for beginners: KaPeGe (German only, sorry)

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
Finally I've found a way to refresh the desktop!

PostMessage, 0x111, 28931,,, ahk_class Progman

"Anything worth doing is worth doing slowly." - Mae West
Posted Image

Joes23
  • Guests
  • Last active:
  • Joined: --

Finally I've found a way to refresh the desktop!

PostMessage, 0x111, 28931,,, ahk_class Progman


Just a question - how in the world did you come up with that? Especially the 28931. Where did you find that?