Right-click menu on Win95 edit controls

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
skanadeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tommy HuiEngineerCommented:
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
skanadeAuthor Commented:
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
abelCommented:
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
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

abelCommented:
Sorry, I was not completely correct.

My information supplies to WinNT. On Win95 NO registry key is being called.
0
skanadeAuthor Commented:
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
abelCommented:
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
Tommy HuiEngineerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.