Discussion:
Understanding DefView, Namespace Extensions And SHChangeNotify
(too old to reply)
Wayne Berry
2007-09-23 17:06:03 UTC
Permalink
Preface: I have been working on a Namespace Extension for 6 months and have
completed almost all of it, except for a few issue I can't seem to resolve
with the Shell API. I have worked all my code paths to the end, and because
of a few, hopefully small, issues I can not complete and need some help. I
have signed up for MSDN and will be posting a few questions to this managed
newsgroup over the next couple of weeks to try to solve my last issues.
Thanks for any help you can give -- I will not give up on this till I figure
it all out.

I have a custom namespace extension, that emulates a hard drive out of My
Computer using the Def View. The namespace extension has folders and files,
and subfolders in both the root and deeper.

For each folder and file I have a unqiue PIDL, and for each file and folder
in a subfolder I have a unqiue PIDL, however if I need fully qualified PIDL
the PIDL chain includes the subfolder PIDLs above it. Much like the shell
does. Any example of a fully qualified PIDL of a file in a subfolder:

DESKTOP -> MY COMPUTER -> NAMESPACE EXTENSION -> SUBFOLDER -> FILE

The problem is: When I call SHChangeNotify to notify the DefView that
something has changed, i.e. I have deleted a file -- the DefView only gets
update when the fully qualified PIDL is in the namespace i.e. like this:

DESKTOP -> MY COMPUTER -> NAMESPACE EXTENSION -> FILE

When I call SHChangeNotify on a fully qualified PIDL that is deeper, i.e. in
a subfolder, the item is not removed/updated in the DefView, example:

DESKTOP -> MY COMPUTER -> NAMESPACE EXTENSION -> SUBFOLDER -> FILE

Is this what is to be expected from DefView?

For some reason the IShellView of DefView isn't getting the SHChangeNotify
message when it is viewing the subfolder. I think my possiblies for fixing
this issue are:

1) Always use unique PIDLs, however the PIDLs are always in the namespace
extension when fully qualified -- i.e. don't have PIDL chains that include
subfolders.

2) I am creating my IShellView from DefView incorrectly when travesing to a
sub folder (via IShellFolder::CreateViewWindow), and shell doesn't know how
to find the view to send SHChangeNotify to DefView.

3) Somehow via ParseDisplay name, and other IShellFolder APIs I am suppose
to tell the Shell how to find the IShellView so that it can send
SHChangeNotify messages to DefView.

4) I am constructing a bad or invalid fully qualified PIDL -- however, I
have checked over my code again and again and it appears correct.

I have also noticed that when I call SHChangeNotifyRegister with a fully
qualfied PIDL that is a file in a subfolder within my namespace extension,
SHChangeNotifyRegister fails. So if DefView is using SHChangeNotifyRegister
and it is failing for the DefView, this might be the reason that my
SHChangeNotify messages are not making it to DefView.

I am looking for someone that knows to say to me -- this is the way you have
to do it, or yes that is a know issue, or I have this working, etc...

Much Thanks In Advance.

-Wayne
v***@gmail.com
2007-09-23 18:39:23 UTC
Permalink
Hi Wayne,

Sample code on http://www.codeplex.com/msf also supports deleting from
NSE. If I remember correctly you need to tell DefView which events to
watch

Victor
Walter Wang [MSFT]
2007-09-24 10:53:28 UTC
Permalink
Hi Wayne,

Welcome to MSDN Managed Newsgroup.

I'm not sure if you've received my last mail about the question
"SHCNE_RMDIR & SHCNE_UPDATEDIR", normally you don't need to call
SHChangeNotify(SHCNE_UPDATEDIR...), the SHCNE_RMDIR should be sufficient.

Do you think it's possible to send me a project to let me reproduce the
issue on my side? or post some code here if it's too big. Thanks.


Sincerely,
Walter Wang (***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
a***@gmail.com
2015-08-18 07:14:13 UTC
Permalink
Post by Wayne Berry
Preface: I have been working on a Namespace Extension for 6 months and have
completed almost all of it, except for a few issue I can't seem to resolve
with the Shell API. I have worked all my code paths to the end, and because
of a few, hopefully small, issues I can not complete and need some help. I
have signed up for MSDN and will be posting a few questions to this managed
newsgroup over the next couple of weeks to try to solve my last issues.
Thanks for any help you can give -- I will not give up on this till I figure
it all out.
I have a custom namespace extension, that emulates a hard drive out of My
Computer using the Def View. The namespace extension has folders and files,
and subfolders in both the root and deeper.
For each folder and file I have a unqiue PIDL, and for each file and folder
in a subfolder I have a unqiue PIDL, however if I need fully qualified PIDL
the PIDL chain includes the subfolder PIDLs above it. Much like the shell
DESKTOP -> MY COMPUTER -> NAMESPACE EXTENSION -> SUBFOLDER -> FILE
The problem is: When I call SHChangeNotify to notify the DefView that
something has changed, i.e. I have deleted a file -- the DefView only gets
DESKTOP -> MY COMPUTER -> NAMESPACE EXTENSION -> FILE
When I call SHChangeNotify on a fully qualified PIDL that is deeper, i.e. in
DESKTOP -> MY COMPUTER -> NAMESPACE EXTENSION -> SUBFOLDER -> FILE
Is this what is to be expected from DefView?
For some reason the IShellView of DefView isn't getting the SHChangeNotify
message when it is viewing the subfolder. I think my possiblies for fixing
1) Always use unique PIDLs, however the PIDLs are always in the namespace
extension when fully qualified -- i.e. don't have PIDL chains that include
subfolders.
2) I am creating my IShellView from DefView incorrectly when travesing to a
sub folder (via IShellFolder::CreateViewWindow), and shell doesn't know how
to find the view to send SHChangeNotify to DefView.
3) Somehow via ParseDisplay name, and other IShellFolder APIs I am suppose
to tell the Shell how to find the IShellView so that it can send
SHChangeNotify messages to DefView.
4) I am constructing a bad or invalid fully qualified PIDL -- however, I
have checked over my code again and again and it appears correct.
I have also noticed that when I call SHChangeNotifyRegister with a fully
qualfied PIDL that is a file in a subfolder within my namespace extension,
SHChangeNotifyRegister fails. So if DefView is using SHChangeNotifyRegister
and it is failing for the DefView, this might be the reason that my
SHChangeNotify messages are not making it to DefView.
I am looking for someone that knows to say to me -- this is the way you have
to do it, or yes that is a know issue, or I have this working, etc...
Much Thanks In Advance.
-Wayne
Hi, you managed resolving this? we can't catch the SHChangeNotify event in our extensions, even though we provide the full PIDL
Loading...