Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Notify shell of change to Active Desktop folder icons?

0 views
Skip to first unread message

Neil J. Rubenking

unread,
May 26, 1998, 3:00:00 AM5/26/98
to

BACKGROUND:
When Active Desktop is installed, the system can use specific icons for
certain folders, rather than always using the default folder icon. This
is accomplished by:

1) Defining the desired icon in a desktop.ini file within the folder
2) Marking the folder as a System folder.

The PathMakeSystemFolder function (found in shlwapi.dll) appears to do
nothing more than set the read-only attribute of the folder. The
desktop.ini file looks something like this:
[.ShellClassInfo]
IconFile=c:\windows\system\shell32.dll
IconIndex=42

You can observe this in c:\windows\favorites\channels - each channel
folder has its own icon.

QUESTION:
HOW do you get Explorer to *notice* a change in this area? If I create a
new desktop.ini and call PathMakeSystemFolder, the new folder-specific
icon is displayed after I restart Windows. That's not acceptable; there
must be some way to send a wake-up call to Explorer.

No, "SHChangeNotify(SHCNE_UPDATEDIR..." doesn't do the job, nor do dozens
of combinations of other SHCNE_xxx constants. Anybody know how to slap
Explorer upside the head and get it to SEE the new icons?
--
Neil J. Rubenking
Contributing Technical Editor
PC Magazine

Mohammed AlQuraishi

unread,
May 26, 1998, 3:00:00 AM5/26/98
to

Hmmm. Refresh usually does it for me. Another way is to close Explorer (end
task), which should reinitialize it without having to reboot the whole
system.

--
****************************************************************************
Mohammed AlQuraishi
SiteBuilder Level 2
ClubIE Team 4
Independent Microsoft Beta Tester
TechWeb/Microsoft 2nd Place ActiveX Contest Winner (Business)
http://www.advancednetsolutions.com

"It is the bias of our society that creates the smart and the stupid." a
*Smart* guy.
"To war is not only to win, it's also to fight."
****************************************************************************
Neil J. Rubenking wrote in message ...

Strohm Armstrong

unread,
May 26, 1998, 3:00:00 AM5/26/98
to

SHChangeNotify is the API you want. Its just a matter of finding the right
flags that will get it to work (if it will work at all). Did you try
SHCNE_ASSOCCHANGED? This might be your only solution.

Neil J. Rubenking

unread,
May 26, 1998, 3:00:00 AM5/26/98
to

In article <#E2iqbPi...@uppssnewspub05.moswest.msn.net>,
str...@microsoft.com.nospam says...

> SHChangeNotify is the API you want. Its just a matter of finding the right
> flags that will get it to work (if it will work at all). Did you try
> SHCNE_ASSOCCHANGED? This might be your only solution.
>
I must admit, I didn't think of using THAT particular constant. I was,
however, considering just writing a test-bed to run through every
possible combination, logical or otherwise. I will definitely start with
SHCNE_ASSOCCHANGED. If that doesn't work, and the all-combinations
doesn't work, I suppose I could try constants that are *NOT* among the
defined SHCNE_xxxx items.

Thanks for insisting I stick with SHChangeNotify. I'll report back when I
find a solution.

Chris Becke

unread,
May 27, 1998, 3:00:00 AM5/27/98
to

Neil J. Rubenking wrote in message ...
>QUESTION:
>HOW do you get Explorer to *notice* a change in this area? If I create a
>new desktop.ini and call PathMakeSystemFolder, the new folder-specific
>icon is displayed after I restart Windows. That's not acceptable; there
>must be some way to send a wake-up call to Explorer.

Question: Do you create the desktop.ini and *then* make system, or the other
way around?
I created a desktop.ini, and then used attrib to make the directory system.
The icon change was instant. However, if I marked system, _then_ made the
desktop.ini I had to refresh the folder view to get the new icon.

hmmm, just playing with notepad, I can't get the shell to not notice the
icon change almost immediately. If I refresh, or simply change to a diffrent
folder and then back, the new icon manifests.

As far as slapping explorer upside the head the following message used to
work:

SendMessage(hwnd, WM_COMMAND, 0x1a065, 0);

Any explorer window getting this message would update its icons, including
the StartMenu. If you add a Find Menu extention to 95, this message will
get explorer to make it visible without a restart. However I don't really
think its worth anything in this situation.

Chris.
--
Email Address: <pu...@qoa.yvn.arg>
Personal Homepage: <http://users.lia.net/chris>
Company Homepage: <http://www.microgaming.com>

Neil J. Rubenking

unread,
May 27, 1998, 3:00:00 AM5/27/98
to

Chris,

I've tried it both ways - first change .ini then PathMakeSystemFolder, or
vice versa. I'm mystified as to why it works fine for you, but your
message is encouraging. I hope today I'll have a chance to come back to
this project - looks like I have enough ideas to try out, certainly.
Thanks!

Chris Becke

unread,
May 28, 1998, 3:00:00 AM5/28/98
to

Neil J. Rubenking wrote:
>Chris,
>
>I've tried it both ways - first change .ini then PathMakeSystemFolder, or
>vice versa. I'm mystified as to why it works fine for you, but your
>message is encouraging. I hope today I'll have a chance to come back to
>this project - looks like I have enough ideas to try out, certainly.
>Thanks!


Be disheartned: I'm using NT4, NOT 95. I think thats why it works so well
for me. I'll boot to 95 after work today and see if I can find anything.

smis...@erols.com

unread,
May 28, 1998, 3:00:00 AM5/28/98
to

Chris, I have toyed with it too, running ie4 on win95, and I have had
the same results as you (instant using attrib +s after making
desktop.ini, slower making desktop.ini after attrib +s and very slow to
remove attrib -s / ren desktop.ini)

Specifically, using a double desktop (standard desktop and common
desktop) with a folder in one of them, I can easily toggle +s, but -s
will usually update just modal windows (not the desktop), which takes a
lot of work to notify (I think rename works).

I would stick to using standard filesystem calls (similar to attrib) as
opposed to that systemize command, because some of the documentation
seems to indicate ReadOnly as critical (it isn't), so my bet is that the
call does not work as expected and should be avoided (use a workaround).

Raymond Chen

unread,
May 29, 1998, 3:00:00 AM5/29/98
to

On Wed, 27 May 1998 11:59:25 +0200, "Chris Becke"
<pu...@qoa.yvn.arg> wrote:
>As far as slapping explorer upside the head the following message used to
>work:
>
> SendMessage(hwnd, WM_COMMAND, 0x1a065, 0);

Don't ever do this. The specific values for WM_COMMAND commands
are internal to Explorer and can (and do) change from version to
version.

--
(My return address is intentionally invalid to foil spammers. Delete the
".---" to get my real address. I do this on my own time with my own money;
my responses are not to be considered official technical support or advice.)

Raymond Chen

unread,
May 29, 1998, 3:00:00 AM5/29/98
to

SHCNE_UPDATEIMAGE. This means "Hey, the icon has changed."

Chris Becke

unread,
May 29, 1998, 3:00:00 AM5/29/98
to

Raymond Chen wrote:
>On Wed, 27 May 1998 11:59:25 +0200, "Chris Becke"
><pu...@qoa.yvn.arg> wrote:
>>As far as slapping explorer upside the head the following message used to
>>work:
>>
>> SendMessage(hwnd, WM_COMMAND, 0x1a065, 0);
>
>Don't ever do this. The specific values for WM_COMMAND commands
>are internal to Explorer and can (and do) change from version to
>version.

Tell that to Symantec. I hacked that message out of their install program
for some ftp client and find menu extension. The install software had the
remarkable ability to add and remove the find menu extension from the find
menu on the fly.

Neil J. Rubenking

unread,
May 29, 1998, 3:00:00 AM5/29/98
to

For what it's worth, a fellow at Microsoft who's working on NT5 was most
emphatic in saying ***DON'T DO THAT!!!!!***.

> >>As far as slapping explorer upside the head the following message used to
> >>work:
> >>
> >> SendMessage(hwnd, WM_COMMAND, 0x1a065, 0);
> >
> >Don't ever do this. The specific values for WM_COMMAND commands
> >are internal to Explorer and can (and do) change from version to
> >version.
>
> Tell that to Symantec. I hacked that message out of their install program
> for some ftp client and find menu extension. The install software had the
> remarkable ability to add and remove the find menu extension from the find
> menu on the fly.

Raymond Chen

unread,
May 31, 1998, 3:00:00 AM5/31/98
to

On Fri, 29 May 1998 09:49:17 +0200, "Chris Becke"
<pu...@qoa.yvn.arg> wrote:
>>The specific values for WM_COMMAND commands
>>are internal to Explorer and can (and do) change from version to
>>version.
>Tell that to Symantec.

Already have. It really sucks when vendors stard hard-coding
stuff and prevent you from changing the system.

0 new messages