Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Right-click menu on Win95 edit controls

Posted on 1998-04-05
7
Medium Priority
?
275 Views
Last Modified: 2013-12-03
I want to write a tool which modifies the standard right-click menu on all the edit controls in Win95. It is not described how to do that anywhere in the Microsoft docs. Can I do that?
Thanks,
Sanjay
0
Comment
Question by:skanade
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1412548
Yes, you need to write a system hook to subclass all of the windows that are of the classname EDIT. Then you need to catch WM_RBUTTONDOWN or WM_CONTEXTMENU to do what you want.

The idea is you need to write a system hook to catch all of the windows in the system. Then you need to subclass every EDIT window. Then you need to watch for specific messages.
0
 

Author Comment

by:skanade
ID: 1412549
System hook is an old method which would work in Windows 3.1 as well. But, it is rather complicated and doesn't exactly let me "modify" the context menu which alread exists. Besides, if I understand it correctly, subclassing solution is suitable only if I want to do it in my own application using the subclassed windows.

No, I am looking for a simpler solution similar to what Windows 95 provides for most of its context menus, called "shell extensions." In Shell extensions, the context menu already exists and you modify it. Don't they have an extension documented for the context menu on the Edit control?

Thanks for your help,
Sanjay
0
 
LVL 39

Expert Comment

by:abel
ID: 1412550
Sanjay,

If you monitor the registry when the user rightclicks in a normal edit window, the only things that are being called are the values HKCU\AppEvents\Schemes and HKCU\AppEvents\Schemes\Apps\.Default\MenuPopup\.Current and the key  HKCU\AppEvents\Schemes\Apps\.Default\MenuPopup\.Current\Active.

These properties are for the sound that's played when a user rightclicks a text control.

There are no other keys or values from the registry that are being called by rightclicking an edit window that might modify that menu.
I'm afraid you have to monitor the system for the messages thui points out. There are several smart ways to do that in a way it doesn't decrease the system's performance.

Regards, Abel
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 39

Expert Comment

by:abel
ID: 1412551
Sorry, I was not completely correct.

My information supplies to WinNT. On Win95 NO registry key is being called.
0
 

Author Comment

by:skanade
ID: 1412552
Thanks, abel.

I think, I would like to reduce to 100 points (if possible?) and award them to Thui if he gives little more details as to which exact functions to call with what parameters to set up the system hooks. And, why does he think subclassing is necessary. All I need to know is that it is an EDIT class for that window handle to which the mouse event is going. Why subclass?
0
 
LVL 39

Expert Comment

by:abel
ID: 1412553
You don't have to subclass, if at all possible. Just process the messages appropriately and you can create a beautifull r-click menu.

As far as I know it's not possible to reduce points. But don't worry, the question is still tough enough. To make a good hook procedure for something like this, is quite difficult, I think.
You asked for which functions to use. I don't what programming language you use, but if you have a good reference, use SetWindowHookEx to process the messages. If you don't have a good reference on it, I can supply you some sample code (or thui, if he still wants to answer, it was his idea to do it this way).

Regards, Abel
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 600 total points
ID: 1412554
You do not need to subclass the windows if you are hooking the messages. My mistake on that. If you are to use the hook, then all you need is to put your hook function into a DLL and use SetWindowsHook() or SetWindowsHookEx().

HHOOK SetWindowsHookEx(WH_MOUSE,
  lpfn,     // address of hook procedure: Must be DLL for system hooks
  hMod,    // handle of application instance
  0 // identity of thread to install hook for
);
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared 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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

722 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