Page 2 of 2

Re: Can't use Win32 SHELLSTATE structure!

Posted: Sun May 11, 2014 12:19 am
by Thunder93
SHGetSetSettings is like you said, its deprecated. However, it still exists and working under Windows 7 x64. However at any time SHGetSetSettings can be removed, like they enjoy pointing out. Who knows though.. maybe they finally removed this function from Windows 8?

You was actually onto something. The problem was you were expecting that final step to actually hide desktop icons on the spot. It would toggle the "Show Desktop Icons" menu item state. This also uses registry item ' HideIcons ' which it toggled with. If you would have re-booted the computer, it would have been obvious it worked the way it was intended to.

I originally thought SHChangeNotify could bring us with that final step. While it refreshed the desktop, it would not consider the Show or Hidden states.

Therefore adding the following, would suffice.

Code: Select all

ShowWindow_(FindWindow_(0, "Program Manager"), #SW_HIDE)

Re: Can't use Win32 SHELLSTATE structure!

Posted: Sun May 11, 2014 1:29 am
by Hi-Toro
Yeah, apparently it does hide the icons on Windows XP, but I'm on 7 (64-bit) and it doesn't. I did actually try SHChangeNotify but obviously to no avail.

It looks like the window-based methods (yours and RASHAD's) actually disable the desktop, rather than just hide the icons -- you can't click-drag the selection rectangle or use the right mouse button. Not sure if that was ever possible, though...

No idea what the 'correct' method for doing this is now -- they probably don't want us to be doing it, even if it's for our own use!

I really appreciate the help on this topic though. Couldn't believe how quickly you guys replied with answers to a pretty obscure problem!

Re: Can't use Win32 SHELLSTATE structure!

Posted: Sun May 11, 2014 1:42 am
by Thunder93
Yes.. I see what you mean, regarding the way it hides. :shock:

Re: Can't use Win32 SHELLSTATE structure!

Posted: Sun May 11, 2014 1:49 am
by Thunder93
Execute the following code, once to hide, again to show. :)

Code: Select all

#toggleDesktopCommand = $7402
hWnd = GetWindow_(FindWindow_("Progman", "Program Manager"), #GW_CHILD)
SendMessage_(hWnd, #WM_COMMAND, #toggleDesktopCommand, 0)

Re: Can't use Win32 SHELLSTATE structure!

Posted: Sun May 11, 2014 8:25 pm
by Hi-Toro
Ohhh, nice one, thanks... works fine here on 64-bit Windows 7!

Re: Can't use Win32 SHELLSTATE structure!

Posted: Sun May 11, 2014 8:36 pm
by Thunder93
I thought that you might like that one. :mrgreen: