|
|
|
date: Tue, 08 Apr 2008 02:59:43 +0200,
group: microsoft.public.platformsdk.shell
back
Re: Detect selection of menu commands from "New" popup menu
I'm not sure this will work, but it might be worth a try:
If you implement an IShellView interface, you may be able to pass it to the
context menu using IObjectWithSite, eg:
IShellView* pMyView;
IContextMenu* pMenu;
// ...
IObjectWithSite* pOWS;
if (SUCCEEDED(pMenu->QueryInterface(IID_IObjectWithSite, (void**)&pOWS)))
{
pOWS->SetSite(pMyView);
pOWS->Release();
}
Once the context menu has your IShellView, it should call
IShellView::SelectItem with the SVSIF_EDIT flag set when it wants an item to
go into rename mode.
At least I believe this is how Explorer does it :)
Cheers,
Jon
"Timo Kunze" wrote in message
news:%2380gWPRmIHA.4536@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> I create a folder's background context menu using
> IShellFolder::CreateViewObject() and display it using TrackPopupMenuEx().
> For the commands from the "New" popup menu, I want to do some special
> handling, so I need a way to tell whether the selected command is from
> this popup menu.
> The command IDs aren't constant, so I thought about decrementing the
> command ID until I find a command with the verb "NewFolder". Since the
> "New" popup menu doesn't seem to use more than 3 IDs, I could keep the
> performance hit small and stop after 2 decrements.
> Then I'd have the first command ID (ID_FIRST) used by the "New" popup
> menu. If the selected command's ID is >= ID_FIRST and <= (ID_FIRST + 2),
> the selected command would be from the "New" popup menu.
> This even works on Windows XP (and probably also on 2003/Vista/2008). But
> on Windows 2000, the "NewFolder" command has no command verb. :-(
>
> How else can I check whether the selected command is part of the "New"
> popup menu? I need this functionality in my Explorer replacement app to
> automatically enter label-edit mode for the newly created item.
>
> Timo
> --
> www.TimoSoft-Software.de - Unicode controls for VB6
> "Those who sacrifice freedom for safety deserve neither."
date: Wed, 16 Apr 2008 22:23:07 +1000
author: Jon Potter am
|
|