Discussion:
How can NSE fill the Explorer's command bar in Windows 7?
(too old to reply)
Timo Partanen
2009-07-02 17:28:30 UTC
Permalink
How can namespace shell extension (NSE) using an own IShellView
implementation (not DefView) fill the Explorer's command bar in Windows 7?
We are using Windows 7 Ultimate Release Candidate.

MSDN contains documentation on interfaces such as IExplorerCommandProvider,
IEnumExplorerCommand and IExplorerCommand that are used to create Explorer
commands, command enumerators and to query those commands. According to the
documentation, commands created via these interfaces are put into the
command bar. The problem is that the NSE's view or folder object is not
called to get an IExplorerCommandProvider interface which was the starting
point in command bar filling in Windows Vista. In detail, Windows Shell
(Explorer) queried for IExplorerCommandProvider on a call to the
IShellFolder::CreateViewObject method of the NSE's shell folder object. Our
command bar integration is working in Windows Vista but the same code is not
working in Windows 7. What is the problem?

Any help is greatly appreciated.
--
Timo Partanen
www.m-files.com
Jialiang Ge [MSFT]
2009-07-03 05:13:50 UTC
Permalink
Hello Timo

This a quick note to let you know that I am performing research on this
issue. I will also try to connect to the shell team and bring their
comments to you. I appreciate your patience.

Regards,
Jialiang Ge (***@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:
***@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
Jialiang Ge [MSFT]
2009-07-05 02:40:04 UTC
Permalink
Hello Timo

Thanks for your patience. I had a discussion with the shell team. In Win7,
the command bar will not request commands from a shell folder (via
IShellFolder::CreateViewObject) unless the shell view proffers itself to the
browser that hosts it. This is a change from Vista.

The shell view can "proffer’ itself to the browser using IProfferService
like this:

IProfferService *pps;
if (SUCCEEDED(pShellBrowser->QueryInterface(IID_PPV_ARGS(&pps))))
{
pps->ProfferService(SID_SFolderView, static_cast<IShellView*>(this),
&_dwCookie);
pps->Release();
}

Also, we recommend that shell folders use the default shell view
implementation, SHCreateShellFolderView.

If you have any other questions or concerns, please feel free to tell me.

Regards,
Jialiang Ge
Microsoft Online Community Support
Post by Jialiang Ge [MSFT]
Hello Timo
This a quick note to let you know that I am performing research on this
issue. I will also try to connect to the shell team and bring their
comments to you. I appreciate your patience.
Regards,
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
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
Timo Partanen
2009-07-06 16:36:34 UTC
Permalink
Post by Jialiang Ge [MSFT]
Hello Timo
Thanks for your patience. I had a discussion with the shell team. In Win7,
the command bar will not request commands from a shell folder (via
IShellFolder::CreateViewObject) unless the shell view proffers itself to
the browser that hosts it. This is a change from Vista.
The shell view can "profferÂ’ itself to the browser using IProfferService
Jialiang, thanks for the info. We were able to make it work by using the
ProfferService function that you suggested. Still a minor additional change
was required. By adding a ProfferService call, everything worked fine in the
command bar _after_ there were selected items in the view. But when no items
were selected and this is the case initially after going to a folder, our
command bar integration was not working. We noticed that an "invalid
argument" error code that was returned from our IFolderView::Items
implementation was causing this strange behavior. The command bar requested
IShellItemArray for selected items in the view and our implementation called
SHCreateShellItemArray with providing zero item-IDs (PIDLs). This caused the
"invalid argument" error code that was interpreted by the command bar as a
serious error. Returning 0x80070490 (this seems to be E_PROP_ID_UNSUPPORTED
in Platform SDK), which is the same what DefView returns in Windows 7 in
this case, instead of E_INVALIDARG solved the problem.

Now, the command bar shows our commands correctly when our NSE is hosted by
Explorer. This works both in Windows Vista and Windows 7. But our commands
are not shown in the command bar if our NSE is hosted by a standard Windows
common dialog box (e.g. in Notepad). This problem appears in Windows Vista
and Windows 7. In detail, our IShellFolder::CreateViewObject implementation
is not queried for IExplorerCommandProvider as it is queried for in
Explorer. What is causing this?
Post by Jialiang Ge [MSFT]
Also, we recommend that shell folders use the default shell view
implementation, SHCreateShellFolderView.
I know, this is a common message. However, using DefView is not an option
for us. We can better make our customers satisfied by providing our custom
shell view implementation. We would expect Microsoft to support custom shell
folder views in addition to DefView in future Windows versions, too. DefView
(SHCreateShellFolderView) should not be the only choice.

Thanks in advance!
--
Timo Partanen
www.m-files.com
Jialiang Ge [MSFT]
2009-07-07 05:21:01 UTC
Permalink
Hello Timo

I'm researching the question. I will update you as soon as possible.

Regards,
Jialiang Ge
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:
***@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
Jialiang Ge [MSFT]
2009-07-08 06:13:55 UTC
Permalink
Hello Timo

I discussed the issue with the shell team. The common file dialog does not
allow the folder (NSE) to extended the command bar verbs. The commands are
currently fixed to the "Organize" menu and the "New Folder" button.

If you have any concerns about it, I can help to record your feedback into
the product database for the shell team's future design references.

Have a nice day!

Regards,
Jialiang Ge
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:
***@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
Timo Partanen
2009-07-08 13:36:34 UTC
Permalink
It is more important that a NSE can add commands to the command bar in
Explorer. Supporting this in a common file dialog box is seen as a minor
need. Anyway, in my opinion, supporting this in common file dialog boxes as
well is useful and important in some cases. The NSE just needs to have a way
to separate whether the host for the commands is Explorer or a common file
dialog box in order to provide different commands depending on the host (if
this is needed).
Post by Jialiang Ge [MSFT]
If you have any concerns about it, I can help to record your feedback into
the product database for the shell team's future design references.
If you helped me in this I would really appreciate it. How should we go?
--
Timo Partanen
www.m-files.com
Timo Partanen
2009-07-10 07:57:10 UTC
Permalink
Post by Timo Partanen
Post by Jialiang Ge [MSFT]
If you have any concerns about it, I can help to record your feedback into
the product database for the shell team's future design references.
If you helped me in this I would really appreciate it. How should we go?
Jialiang, what should I do to record our feedback to the product database?
Could you help me in this issue?
--
Timo Partanen
www.m-files.com
Jialiang Ge [MSFT]
2009-07-10 10:39:44 UTC
Permalink
Hello Timo

Please describe the business impact when lacking the functionality to
customize more commands in a common file dialog box. You can send the
information to me offline. My email address can be found in the signature.
I will report this to the shell team.

Regards,
Jialiang Ge (***@microsoft.com)
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:
***@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
unknown
2009-10-13 12:13:43 UTC
Permalink
Hi Timo, Can you please tell me how to Proffer my customized shellview so that i can add items to command bar in windows 7. It is working fine in vista.I saw the above code but not able to implement those code in my shell view. I don't know where and how to Proffer. So please help me regarding this(uregently).

thanks,
tuunoo



Timo Partanen wrote:

Re: How can NSE fill the Explorer's command bar in Windows 7?
06-Jul-09

"Jialiang Ge [MSFT]" <***@online.microsoft.com> wrote in message news:E5362A1E-2385-45C2-A8DB-***@microsoft.com..

Jialiang, thanks for the info. We were able to make it work by using the
ProfferService function that you suggested. Still a minor additional change
was required. By adding a ProfferService call, everything worked fine in the
command bar _after_ there were selected items in the view. But when no items
were selected and this is the case initially after going to a folder, our
command bar integration was not working. We noticed that an "invalid
argument" error code that was returned from our IFolderView::Items
implementation was causing this strange behavior. The command bar requested
IShellItemArray for selected items in the view and our implementation called
SHCreateShellItemArray with providing zero item-IDs (PIDLs). This caused the
"invalid argument" error code that was interpreted by the command bar as a
serious error. Returning 0x80070490 (this seems to be E_PROP_ID_UNSUPPORTED
in Platform SDK), which is the same what DefView returns in Windows 7 in
this case, instead of E_INVALIDARG solved the problem

Now, the command bar shows our commands correctly when our NSE is hosted by
Explorer. This works both in Windows Vista and Windows 7. But our commands
are not shown in the command bar if our NSE is hosted by a standard Windows
common dialog box (e.g. in Notepad). This problem appears in Windows Vista
and Windows 7. In detail, our IShellFolder::CreateViewObject implementation
is not queried for IExplorerCommandProvider as it is queried for in
Explorer. What is causing this

I know, this is a common message. However, using DefView is not an option
for us. We can better make our customers satisfied by providing our custom
shell view implementation. We would expect Microsoft to support custom shell
folder views in addition to DefView in future Windows versions, too. DefView
(SHCreateShellFolderView) should not be the only choice

Thanks in advance

--
Timo Partane
www.m-files.com

EggHeadCafe - Software Developer Portal of Choice
Callback and Manual Partial Page Rendering
http://www.eggheadcafe.com/tutorials/aspnet/ac08f984-7e5d-4b5e-8cb4-00afc3fb9222/callback-and-manual-parti.aspx
Timo Partanen
2009-10-26 03:16:03 UTC
Permalink
Post by unknown
Hi Timo, Can you please tell me how to Proffer my customized shellview so
that i can add items to command bar in windows 7. It is working fine in
vista.I saw the above code but not able to implement those code in my
shell view. I don't know where and how to Proffer. So please help me
regarding this(uregently).
In your IShellView(n)::CreateViewWindow(n) implementation:

// Ask IProfferService from Shell Browser.
CComPtr< IProfferService > spProfferService;
if( SUCCEEDED( psb->QueryInterface( IID_IProfferService, ( void** )
&spProfferService ) ) )
{
DWORD dwCookie = 0;
if( SUCCEEDED( spProfferService->ProfferService(
SID_SFolderView, static_cast< IServiceProvider* >( this ),
&dwCookie ) ) )
{
m_dwProfferServiceCookie = dwCookie;
}
}

In your IShellView::DestroyViewWindow implementation:

- Get IProfferService
- Call its RevokeService with the previously received cookie
(m_dwProfferServiceCookie)

Hope this helps.

--
Timo Partanen
www.m-files.com

Loading...