c++ - IContextMenu3 HandleMenuMsg2 is never called -


I try to apply a shell extension that IContextMenu3 and IShellExtInit , and I'm inserting the menu item in the method section but the method described in your project is called HandleMenuMsg2 or HandleMenuMsg .

Can anyone please tell me what is required to get the code> HandleMenuMsg2 call

My ATL object is implemented like that:

  // CTestPlugin class ATL_NO_VTABLE CTestPlugin: public CComObjectRootEx & lt; CComMultiThreadModel & gt ;, Public CComCoClass & LT; CTestPlugin, & amp; CLSID_CTestPlugin & gt ;, Public IshellExtInit, Public IContextMenu3 {Public: CTestPlugin (); ~ CTestPlugin (); HRESULT Final Construct (); Zero final release (); Public: DECLARE_REGISTRY_RESOURCEID (IDR_TESTPLUGIN) DECLARE_NOT_AGGREGATABLE (CTestPlugin) BEGIN_COM_MAP (CTestPlugin) COM_INTERFACE_ENTRY (IShellExtInit) COM_INTERFACE_ENTRY (IContextMenu) COM_INTERFACE_ENTRY (IContextMenu2) COM_INTERFACE_ENTRY (IContextMenu3) END_COM_MAP () DECLARE_PROTECT_FINAL_CONSTRUCT () ... // IShellExtInit STDMETHODIMP start (LPCITEMIDLIST, LPDATAOBJECT, HKEY ); // IContextMenu STDMETHODIMP GetCommandString (UINT, UINT, UINT *, LPSTR, UINT) {return S_OK; } STDMATHIMIM Invoic Command (LPCMINIFOKMMA) STDMETHODIMP querycontactmu (HMNU, UINT, UINT, UINT, UINT); // IContextMenu2 STDMETHODIMP handlen message (UINT UMGS, WARADAM Y PARAM, LAPRM LPAMM); // IContextMenu3 STDMETHODIMP Handleman Message 2 (UINT UMGS, VARAMUM VAPAM, LAPRM LPRAM, LARESCALT * PRSLUT);  

And I'm inserting the menu items as described in the nanoant page:

  bool CTestPlugin :: AddNewMenuItem (HMENU hmenu, uint un_menu_text_id, uint un_menu_index , UINT icon, UINT and UCMDID) {TCHR CETEX [MAX_PATH]; :: LoadString (_AtlModule.m_hResInstance, un_menu_text_id, chText, MAX_PATH); MENUITEMINFO menuiteminfo; Zoramori (& amp; menuitifenoid, psychophagus); Menuiteminfo.cbSize = sizeof (menuiteminfo); Menuiteminfo.fMask = MIIM_FTYPE | MIIM_ID | MIIM_SUBMENU | MIIM_DATA | MIIM_BITMAP | MIIM_STRING; Menuiteminfo.fType = MFT_STRING; Menuiteminfo.dwTypeData = chText; Menuiteminfo.cch = _tcslen (chText); If (icon) {menuiteminfo.hbmpItem = SysInfo :: instance (). IsVistaOrLater ()? _AtlModule.m_iconBitmapUtils.IconToBitmapPARGB32 (_AtlModule.m_hResInstance, Icon): HBMMENCancback; } Menuiteminfo.wID = (UINT) uCmdID ++; M_mapIdToIcon [menuiteminfo.wID] = Icon; Return (TRUE == InsertMenuItem (hmenu, un_menu_index, TRUE, and menuiteminfo)); } STDMETHODIMP CitizenPlugin :: HandelmenUmages (UINT UMGS, VARAM VOATAM, LAPRM LPARM) {Alcestral Ridge; Return HandelMenusSm2 (UMGS, WPAMM, LPARM, and SCS); } STDMETHODIMP CTestPlugin :: HandleMenuMsg2 (uint uMsg, wParam wParam, lParam lParam, LRESULT * pResult) {...}  

All this menu entries with apear but no picture in the Explorer context menu Are displayed, both methods handlines and handmanusmos2 are never called, and the system I am testing is WinXP (Vista is all right because We are hbmpItem ).

I'm missing some inicialization or what? Can anyone explain me?

Thanks

I am working on this today, and for your question Crossed As I use pure WinAPI, I am not sure about the MFC semantics, but my best estimate is that your QueryInterface () may be based on the IContextMenu3 interface

(Although you have solved this problem long before. However, it may be used to know others.)

< / Html>

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -