Solved

Popup menu added to context menu (shell extension)

Posted on 1998-10-15
1
558 Views
Last Modified: 2013-12-03
I am writing a context menu shell extension.  How is it possible to have the item added to the context menu be a popup menu?  It would seem that calling InsertMenu using MF_POPUP does nothing and yet does not return 0.  I'm quite sure I've seen context menu shell extensions do this.
0
Comment
Question by:mrgentry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 1415296
mrgentry,

the following code is Delphi code. But I think you'll get how it works...

function TContextMenu.QueryContextMenu(Menu: HMENU; indexMenu,idCmdFirst,idCmdLast,uFlags: UINT) : HResult;
var c1       : cardinal;
    keyState : TKeyboardState;
    cc,ci    : cardinal;
begin
  result:=0;
  if (uFlags and CMF_VERBSONLY=0) and (uFlags and CMF_EXPLORE=0) and (uFlags and $F<>0) then
    exit;
  cc:=idCmdFirst; ci:=indexMenu;
  c1:=CreatePopupMenu;
  AppendMenu(c1, MF_STRING,    cc, 'Kontextmenü bearbeiten'); inc(cc);
  AppendMenu(c1, MF_SEPARATOR, 0,  nil                     );
  AppendMenu(c1, MF_STRING,    cc, 'Info'                  ); inc(cc);
  AppendMenu(c1, MF_STRING,    cc, 'Einstellungen'         ); inc(cc);
  InsertMenu(Menu, ci, MF_STRING or MF_POPUP or MF_BYPOSITION, c1, 'popup menu'); inc(ci);
  result:=ci-indexMenu;
end;

Regards, Madshi.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 107
ODBC Connection; Switch between 2 SQL Databases VBA 11 129
Issue when running a SSIS package (.dts) from an SQL job 21 84
Example of WebAPI 7 35
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question