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

Multiple SHChangeNotify's: Shell ignores most of them?

208 views
Skip to first unread message

Hein

unread,
Oct 4, 2003, 9:01:22 AM10/4/03
to
I've written a shell extension displaying overlay icons for files, and I'm
trying to get Explorer to update the file icon, displaying a changed
overlay. I use "SHChangeNotify(SHCNE_UPDATEITEM,...", but it only works when
I send very few notifycations at a time. When I try to update 10 or more
files at once, Explorer ignores (most of ) the notifications. Anyone
experiencing the same behavior, and knows how to work around it?

-Hartmut


Jim Barry

unread,
Oct 11, 2003, 4:16:55 PM10/11/03
to

This is a well-known limitation of the shell update mechanism. You should be able to find some discussion about it by searching past messages from this group (http://groups.google.com).

--
Jim Barry, MVP for Windows SDK
"Honor Bound to Defend Freedom" - slogan displayed at the gates of Camp
Delta, Guantanamo Bay, Cuba, where over 600 prisoners are held indefinitely
by the U.S. military, without trial, in defiance of international law.

Raymond Chen

unread,
Oct 12, 2003, 1:45:42 AM10/12/03
to
SHChangeNotify is not a general-purpose IPC mechanism. For perf reasons, if
you generate lots of notifications at once, the shell tries to combine them
to reduce message traffic. E.g., if you send out fifty "update items", the
shell will combine them into a single "update directory".

Otherwise you could launch a denial of service attack by going to a
directory and continuously updating files. Each one would create a separate
notification and soon explorer would run out of memory.

"Jim Barry" <j...@mvps.org> wrote in message
news:%23%23D2eSDk...@tk2msftngp13.phx.gbl...

bynt-T U.S. military, without trial, in defiance of international law.


David Lowndes

unread,
Oct 13, 2003, 5:32:14 AM10/13/03
to
>SHChangeNotify is not a general-purpose IPC mechanism. For perf reasons, if
>you generate lots of notifications at once, the shell tries to combine them
>to reduce message traffic. E.g., if you send out fifty "update items", the
>shell will combine them into a single "update directory".

Raymond,

That sounds reasonable, but where's the documentation of this
behaviour?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Raymond Chen

unread,
Oct 17, 2003, 11:07:59 PM10/17/03
to
This is one of those things you're not supposed to notice. If you send a lot
of file update notifications, they get combined into a single "directory
update" notification, and Explorer refreshes the entire directory - so the
operation still succeeds; the items you sent notifications on did get
updated. (as did a bunch of files that you didn't send notifications on, but
no harm done there)

"David Lowndes" <dav...@mvps.org> wrote in message
news:i6skovs0t5udhr93q...@4ax.com...

David Lowndes

unread,
Oct 18, 2003, 4:13:13 AM10/18/03
to
>This is one of those things you're not supposed to notice. If you send a lot
>of file update notifications, they get combined into a single "directory
>update" notification, and Explorer refreshes the entire directory - so the
>operation still succeeds; the items you sent notifications on did get
>updated. (as did a bunch of files that you didn't send notifications on, but
>no harm done there)

It's OK that Explorer will refresh, but a 3'rd party application using
SHChangeNotifyRegister that doesn't know these rules may not be
monitoring for the amalgamated notification.

So, what do you think - shouldn't this behaviour be documented?

Raymond Chen

unread,
Oct 18, 2003, 2:07:08 PM10/18/03
to
Good point - I had forgotten that SHChangeNotifyRegister is now a documented
function.

"David Lowndes" <dav...@mvps.org> wrote in message

news:a5t1pvo46fd1iqf77...@4ax.com...

Patrick Walsh

unread,
Oct 21, 2003, 8:27:48 AM10/21/03
to
The workaround for preventing the shell of collapsing your events is to
include the flag SHCNF_FLUSH when you call ShChangeNotify. this will
garantee that the message will be delivered. See ShChangeNotify
documentation


"Hein" <m...@temp.com> wrote in message
news:uxoieen...@tk2msftngp13.phx.gbl...

0 new messages