Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Wed, 18 Jun 2008 02:42:28 -0700 (PDT),    group: microsoft.public.platformsdk.shell        back       


Extra context menu entry 'paste' in shell extn icon   
hi All,

I have a shell extension for which i have my own separate context
menu..
when i register the nse, at the icon level, i see an extra entry
'Paste' in the context menu..this context menu also has the entries
added by me in separate handler..how can i remove this paste entry
from context menu..this apperas only when i right click the icon of my
nse and no where else.
the callstack is given below
>	MyNSE.dll!CFolderContextMenu::QueryContextMenu(HMENU__ * hMenu=0x079e0911, unsigned int indexMenu=0, unsigned int idCmdFirst=38, unsigned int idCmdLast=32762, unsigned int uFlags=20)  Line 5887	C++
 	shell32.dll!_HDXA_AppendMenuItems2@36()  - 0x5e bytes
 	shell32.dll!CDefFolderMenu::QueryContextMenu()  + 0x2c1 bytes
 	shdocvw.dll!CNscTree::_CreateContextMenu()  + 0x3d bytes
 	shdocvw.dll!CNscTree::_OnContextMenu()  + 0x14a bytes
 	shdocvw.dll!CNscTree::_OnNotify()  + 0x3a4 bytes
 	shdocvw.dll!CNscTree::OnWinEvent()  + 0x51 bytes
 	shdocvw.dll!CNSCBand::OnWinEvent()  + 0x70 bytes
TIA,
rgds
Anu
date: Wed, 18 Jun 2008 02:42:28 -0700 (PDT)   author:   Anu

Re: Extra context menu entry 'paste' in shell extn icon   
Anu wrote:
> I have a shell extension for which i have my own separate context
> menu..
> when i register the nse, at the icon level, i see an extra entry
> 'Paste' in the context menu..this context menu also has the entries
> added by me in separate handler..how can i remove this paste entry
> from context menu..this apperas only when i right click the icon of my
> nse and no where else.

The shell adds the "Paste" item if your drop target (as returned by CreateViewObject) returns any drop effect flags from its IDropTarget::DragEnter method. To prevent the "Paste" item from appearing, either return DROPEFFECT_NONE from DragEnter, or don't expose IDropTarget at all. However, I think it's much better to handle the shell's "Paste" command (by implementing IDropTarget::Drop) instead of adding your own menu item.

-- 
Jim Barry, Microsoft MVP
date: Fri, 20 Jun 2008 14:30:56 +0100   author:   Jim Barry

Re: Extra context menu entry 'paste' in shell extn icon   
On Jun 20, 6:30 pm, "Jim Barry"  wrote:
> Anu wrote:
> > I have a shell extension for which i have my own separate context
> > menu..
> > when i register the nse, at the icon level, i see an extra entry
> > 'Paste' in the context menu..this context menu also has the entries
> > added by me in separate handler..how can i remove this paste entry
> > from context menu..this apperas only when i right click the icon of my
> > nse and no where else.
>
> The shell adds the "Paste" item if your drop target (as returned by CreateViewObject) returns any drop effect flags from its IDropTarget::DragEnter method. To prevent the "Paste" item from appearing, either return DROPEFFECT_NONE from DragEnter, or don't expose IDropTarget at all. However, I think it's much better to handle the shell's "Paste" command (by implementing IDropTarget::Drop) instead of adding your own menu item.
>
> --
> Jim Barry, Microsoft MVP

Thanks a lot.
It worked.
Rgds,
Anu
date: Sun, 22 Jun 2008 23:37:46 -0700 (PDT)   author:   Anu

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us