|
|
|
date: Fri, 04 Apr 2008 17:23:24 -0500,
group: microsoft.public.platformsdk.shell
back
RE: IContextMenu with a shortcut and another file/folder selected
Hello Craig,
From your post, my understanding on this issue is: when both a file and a
shortcut (lnk) are selected in windows explorer, our shell extension
IShellExtInit.Initialize only gets the shortcut's name if the focus rect is
on the shortcut. If I'm off base, please feel free to let me know.
I reproduced the issue when I set the shell call for any file by
registering as a context menu handler under the HKCR\* key. The resolution
is to register it under the HKCR\lnkfile key along with the HKCR\* key:
Part of my test rgs file is as follows:
NoRemove *
{
NoRemove ShellEx
{
NoRemove ContextMenuHandlers
{
ForceRemove SimpleShlExt = s
'{5E2121EE-0300-11D4-8D3B-444553540000}'
}
}
}
NoRemove lnkfile
{
NoRemove ShellEx
{
NoRemove ContextMenuHandlers
{
ForceRemove SimpleShlExt = s
'{5E2121EE-0300-11D4-8D3B-444553540000}'
}
}
}
The lnkfile is treated as a special case by windows explorer. After
registering lnkfile for the shell extension, the lnkfile will be treated as
normal file as others. Craig, and David, please have a try and let me know
if it works for you.
Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
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.
date: Mon, 07 Apr 2008 08:32:33 GMT
author: (Jialiang Ge [MSFT])
Re: IContextMenu with a shortcut and another file/folder selected
Thank you for the feedback. I also see the side effect that
IContextMenu::QueryContextMenu is called twice. Based on my further tests
and researches, this side effect may be fixed by suppressing the context
menu received via the * registration on lnk files, and add only one menu
item to the context menu using these 2 instances. In other words, if a
lnkfile menu has been added to the context menu, then do nothing. If a
non-link file has been added, and we detect that the first file from
DragQueryFile is a lnk file, then remove it and add the lnkfile.
Craig, Please also note that the order in which our context menu extension
is called is not guaranteed. It may be called for the lnkfile registration
before the * registration on some systems and after on others. Relying on
this order will lead to invalid and unpredictable results. Therefore, we
cannot reply on the order of Initialize to decide which is which and which
one to suppress.
Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
date: Tue, 08 Apr 2008 03:21:59 GMT
author: (Jialiang Ge [MSFT])
Re: IContextMenu with a shortcut and another file/folder selected
Yes, exactly. Thank you, Craig, for the summary.
Registering both "*" and "lnkfile" should be on the right track of the
issue. And an *unavoidable* side effect of this is the two objects being
created. What we can do next is to find some workarounds to suppress one of
the two, according to our *specific* design request. Craig's detailed steps
show a workaround for his design request that all the lnk files should be
treated as normal files. Hi Dave, I am not sure if I understand your design
request correctly, if you have followup questions, would you send me an
email and we can discuss it offline?
Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
date: Wed, 09 Apr 2008 12:37:25 GMT
author: (Jialiang Ge [MSFT])
|
|