[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Popup menu added to context menu (shell extension)

Posted on 1998-10-15
1
Medium Priority
?
561 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 400 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 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