Custom item in context menu
-
Richard MacCutchan wrote:
I don't think so, kernel code is not accessible by user programs.
I guess you are not familiar with WinDbg tool. It is a debugger which can run in kernel mode. And in kernel mode debugging ,breakpoints can be set everywhere including kernel code.
Richard MacCutchan wrote:
Possibly, but I'm not sure it's that straightforward.
Sure it is not so. Thanks for comment anyway.
-
devboycpp wrote:
a debugger which can run in kernel mode.
I have never used WinDbg, something else to add to my list of things to learn.
One of these days I'm going to think of a really clever signature.
-
Why, is it relevant to anything?
One of these days I'm going to think of a really clever signature.
-
Richard MacCutchan wrote:
Why, is it relevant to anything?
No just the reason is why people put their age in their profile. Just to let people know. I don't mean to relate it to anything.
-
Sorry I don't understand. I don't have my age in my profile and nor do most people, so where did this question come from?
One of these days I'm going to think of a really clever signature.
Richard MacCutchan wrote:
I don't have my age in my profile and nor do most people, so where did this question come from?
But some have their age in their profile. For example you have told in your profile "I hope someday I will become a real programmer" because you want others to know it. Otherwise you could just say what does it have to do with other people. I don't care. Probably you don't want others to know your age for personal reasons and I respect it.
-
Richard MacCutchan wrote:
I don't have my age in my profile and nor do most people, so where did this question come from?
But some have their age in their profile. For example you have told in your profile "I hope someday I will become a real programmer" because you want others to know it. Otherwise you could just say what does it have to do with other people. I don't care. Probably you don't want others to know your age for personal reasons and I respect it.
What people put in their profile may not have anything to do with reality, don't take it too literally.
devboycpp wrote:
I hope someday I will become a real programmer
I still hope this.
One of these days I'm going to think of a really clever signature.
-
How can an item be added to context menu that pops up when highlighting a part of text in any program and right clicking ? And a code should be associated with that which processes the piece of text highlighted. The item should be added to every programs context menu when text can be selected;ex Internet Explorer , Firefox , notepad, etc... I have some general methods in my mind from my studies revolving around windows internals. But no specifics. What is the best way to do it ? can this be done by writing code in kernel mode ? how ? is it necessary ? what are other methods which involve user mode programming ?
As already noted by Richard, this can't be simply done if there is no method provided like for the Explorer. I will try to explain how context menus are handled: When clicking the right mouse button, the window under the mouse cursor will get a
WM_CONTEXTMENU
message. When pressing the context menu button on the keyboard (commonly left of the right ctrl key), the window which has the focus will receive this message. TheWM_CONTEXTMENU
handler will then create and show the menu. This is usually done by loading it from resources. But the complete menu or portions may be also created dynamically by code. It is also common practice to modify resource based menus dynamically according the current context (gray out, remove, add, or change items and sub menus). To modify a menu, you must know the handle that is assigned upon menu creation (with resource based menus the handle of the sub-menu because that contains the items). If you want to insert new items, you must also know about the existing items (order, position, sub menus, separators). If you really want to try it, you must hook the API functionsCreateMenu()
,CreatePopupMenu()
, andTrackPopupMenu[Ex]()
. But I'm not sure if this will work.