Hi Dennis,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to add a menu item to all the
TextBox context menu in windows. If there is any misunderstanding, please
feel free to let me know.
To modify the context menu of a certain TextBox, we have to handle the
WndProc function and capture the WM_CONTEXTMENU message. Here is a KB for
this:
http://support.microsoft.com/?id=224302
If we want to change all the TextBox's context menu in Windows, we have to
set a global hook. However, global hook is not supported in .NET Framework.
You cannot implement global hooks in Microsoft .NET Framework. To install a
global hook, a hook must have a native dynamic-link library (DLL) export to
inject itself in another process that requires a valid, consistent function
to call into. This requires a DLL export, which .NET Framework does not
support. Managed code has no concept of a consistent value for a function
pointer because these function pointers are proxies that are built
dynamically.
For more information, please check the following link for more information.
http://support.microsoft.com/?id=318804
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."