Solved

Shell pop-up menu item hint on status bar

Posted on 1998-05-16
10
379 Views
Last Modified: 2013-12-03
I have written a program (in Delphi) which has an option to put itself on the pop-up menu or "shell shortcut" menu that is displayed when mouse button 2 is clicked on a drive or folder in Windows Explorer and in other Windows shell utilities such as My Computer, drive and folder windows and open/save dialog boxes.

To do this, my program inserts an entry into the registry for each of 'Drive' and 'Directory' as follows:

    HKEY_CLASSES_ROOT\ddd\shell\Folder &Sizer\command\
    (Default)\'ppp\FOLSIZER.EXE "%1"'

where ddd = 'Drive' or 'Directory', ppp = path of the program's folder.  Folder Sizer (FOLSIZER.EXE) is the name of my program.

In addition to the command to be executed for the menu item, which is shown in the above registry entry, I would also like to insert a hint or description to appear on the status bar of the My Computer window and of drive and folder windows.  Without this, the default is simply to show the application name as shown in the registry key.  Unfortunately, it actually shows literally as 'Folder &Sizer', including the '&', which looks silly!  (The '&' is not shown on the pop-up menu:  instead it functions to underline the 'S' and make 'S' the hot key.)

So how can I replace the default hint with a more suitable alternative, such as 'Analyse the drive with Folder Sizer'?

(No comments about my non-American spelling of 'Analyse', please.  :-))
0
Comment
Question by:SimonORorke
  • 4
  • 4
  • 2
10 Comments
 
LVL 3

Expert Comment

by:tma050898
ID: 1402267
Unfortunately, as far as I know there is no way to do what you want with a static registry entry. I believe you need to install a context menu handler and implement the IContextMenu interface.

Take a look at the registry entires for "QuickView". As you can see, they've done what you did in order to get their entry on the context menu. However, I could not locate the actual text that you see when you mouse over the "Quick View" menu entry. Same thing for WinZip. Therefore, I can only summise that you need to write a context menu handler if you want "help text". In addition, another piece of info that makes me thing that you need to implement the IContextMenu interface to set the "help text" is the fact that IContextMenu has a method called GetCommandString that can be used to retrieve the "help text".

Hopefully, this will at least get you pointed in the right direction. If this isn't specific enough, maybe someone else can shed more light on how this works...
0
 

Author Comment

by:SimonORorke
ID: 1402268
I have heard of context menu handlers and I did wonder if I would have to use one.  But I cannot find anything about them in Win 32 Programmer's Reference or in my Delphi references.  Delphi does have a TRegistry object, but it clearly does not provide any facilities specifically for context menu handlers.  So I have no idea how to go about making one.  But I am willing to learn.  I suppose I would need a book on the registry to work out how to do it myself.  So, tma's proposed answer is not enough, and regrettably I must throw the question open to other experts.  Hopefully someone can give me enough info to do the job.

This is one of those questions where it is difficult to know whether to put it in the Windows Programming topic, as I have done, or the Delphi topic.  If the answer involves using MFC or OWL C++ classes, it will not help me.  On the other hand, I know enough about C to understand code samples of API calls embedded in C.  In any case, I do not need general info on how to put things in the registry.  Delphi's TRegistry makes that easy.  I just need to know more about context menu handlers.  

Alternatively, there is the possibility that I can do what I want with a static registry entry after all, in which case I shall forgo the pleasure of tackling context menu handlers for now!
0
 

Author Comment

by:SimonORorke
ID: 1402269
Adjusted points to 200
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:SimonORorke
ID: 1402270
Having looked into this a bit more, I have decided not to do it.  I would need to write a DLL, which means I would have to bundle it and my little freeware program in a proper install program, which, I found, would make the whole thing five times the size and therefore less attractive for people to download.  It is not worth it for such a small improvement.  

Besides, I found the explanation of how to do context menu handlers in a big fat book, "The Delphi Developer's Guide", and it takes several pages.  Not the sort of thing that would be easy to work through in Experts' Exchange, by the look of it.

So, tma, if you would like to repeat your proposed answer, I will give you some points for pointing me in the right direction and close the question.  Thanks for your help.
0
 
LVL 3

Accepted Solution

by:
tma050898 earned 200 total points
ID: 1402271
Simon,

You're very welcome.

I agree that writing a context menu handler isn't a trival task. Actually, I was kinda hoping that you would find that I was wrong and that there was a way of having "help text" with a static registry entry. However, everything that I had read also pointed to needing a handler.

Cheers,
Tom

0
 
LVL 3

Expert Comment

by:tma050898
ID: 1402272
GREAT!!! I answer your question and you don't like the fact that you're going to actually have to code something and you give me a 'D'. Hey, buddy, it's not my fault you don't have the time to to code this. I took over an hour researching this for you attempting to find an easier solution. Don't hold it against me that MickySoft makes this hard. The answer I came up with was perfectly valid.

Tom Archer
0
 
LVL 7

Expert Comment

by:linda101698
ID: 1402273
Under the guidelines of Experts Exchange, an answer is a specific response to a specific question.  If tma gave a response that was reasonable for the question you asked then he has answered your question.

The guidelines for what is a question and answer are located at the following URL for your review.

http://www.experts-exchange.com/info/qna.htm

Linda Gardner
Customer Service @ Experts Exchange
0
 

Author Comment

by:SimonORorke
ID: 1402274
Sorry, I stand corrected.  I am new to this.  Please submit your answer again for regrading, tma, or let me know whatever else I need to do to rectify your anwser's grade.
0
 
LVL 3

Expert Comment

by:tma050898
ID: 1402275
Thanks, Simon. We all make mistakes. However, it takes someone with class to accept erring and attempt to correct it. Unfortunately, I can not "resubmit" my answer because it has already been accepted and graded. However, if you wish, you can contact Linda (linda@experts-exchange.com) and she can adjust the points.

Tom Archer

0
 
LVL 7

Expert Comment

by:linda101698
ID: 1402276
I'll post a question for tma so I can add some quality points to his account.  Look for the question in the topic area,

Linda
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Please explain "Multi-Tenant Services" 5 99
SSRS troubles 4 69
Please explain purpose of GZIP 4 36
SSRS Deployment problem 5 66
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 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