Page 1 of 1
How do I create a KB shortcut for a Context Menu item?
Posted: 07 Jun 2009 20:26
by Mesh
Okay, quick question - what's the best way to create a KB shortcut for a context menu item? Would this require a script of some sort, or is there another way to do it?
If you want a practical example, think of a context menu item to virus scan whatever is selected (i.e. folder(s), file(s), etc...).
Re: How do I create a KB shortcut for a Context Menu item?
Posted: 08 Jun 2009 14:29
by admin
If you mean the Shell context menu: no way.
Re: How do I create a KB shortcut for a Context Menu item?
Posted: 08 Jun 2009 15:48
by Mesh
admin wrote:
If you mean the Shell context menu: no way.
Ouch. Okay, is there a point for me to make this a feature request, or does this fall into the category of something that is not technically possible?
Re: How do I create a KB shortcut for a Context Menu item?
Posted: 08 Jun 2009 15:56
by admin
Mesh wrote:admin wrote:
If you mean the Shell context menu: no way.
Ouch. Okay, is there a point for me to make this a feature request, or does this fall into the category of something that is not technically possible?
Not possible.
But usually it should be quite easy to write a UDC doing the job and assign a KS to it.
Re: How do I create a KB shortcut for a Context Menu item?
Posted: 08 Jun 2009 17:53
by Mesh
admin wrote:
Not possible.
But usually it should be quite easy to write a UDC doing the job and assign a KS to it.
Hmm. If it's a standard application launch with passed parameters to the selected items, maybe. But certain items, like the virus scan, are handled by a shell DLL - and I'm not sure that can be handled quite so cleanly.
Without programmed support, I'm not sure there's a way it can be done, short of a recorded set of keystrokes to call up the context menu and select the correct item - which is dicey, because the context menu doesn't always come up immediately.
Hmm...
Re: How do I create a KB shortcut for a Context Menu item?
Posted: 11 Jun 2009 22:27
by admin
Mesh wrote:admin wrote:
If you mean the Shell context menu: no way.
Ouch. Okay, is there a point for me to make this a feature request, or does this fall into the category of something that is not technically possible?
Actually I learned how to do this. However, you need the exact shell menu item caption including the accelerator (&), e.g. "Scan selected files with Anti&Vir".
So I could add a new script command
InvokeShellCommand command where command is the shell menu item caption. You would then create a UDC Run Script looking like this:
Code: Select all
InvokeShellCommand "Scan selected files with Anti&Vir";
and assign a KS to it.
Re: How do I create a KB shortcut for a Context Menu item?
Posted: 11 Jun 2009 22:34
by Mesh
admin wrote:
Actually I learned how to do this. However, you need the exact shell menu item caption including the accelerator (&), e.g. "Scan selected files with Anti&Vir".
That sounds great! As long as it preserves whatever is actively selected (whether folder(s) or file(s), or both), then that sounds perfect.
Thanks for looking into this.

Re: How do I create a KB shortcut for a Context Menu item?
Posted: 11 Jun 2009 22:41
by admin
Mesh wrote:admin wrote:
Actually I learned how to do this. However, you need the exact shell menu item caption including the accelerator (&), e.g. "Scan selected files with Anti&Vir".
That sounds great! As long as it preserves whatever is actively selected (whether folder(s) or file(s), or both), then that sounds perfect.
Thanks for looking into this.

There's one problem still: I don't get it to work with multiple selected items.

Just one item a time... arrgh.
Re: How do I create a KB shortcut for a Context Menu item?
Posted: 11 Jun 2009 22:46
by Mesh
Actually, I've got another quick question... Would this command work for *any* context menu item? Or only ones handled by a DLL? The answer determines whether users need to scour the registry to figure it out before determining whether to use the script approach, or to use a UDC approach.
Re: How do I create a KB shortcut for a Context Menu item?
Posted: 11 Jun 2009 22:50
by Mesh
admin wrote:
There's one problem still: I don't get it to work with multiple selected items.

Just one item a time... arrgh.
I'm not sure I understand the complexity behind this. XY is obviously able to integrate with the context menu - so if XY can trigger a context menu item through manual mouse clicking, I would think it shouldn't be that difficult to provide an alternate way of triggering the same action.
Hmm... this could be a new branch of features for XY, if you wanted it - very detailed and granular support for customizing and scripting items on the context menu.

Re: How do I create a KB shortcut for a Context Menu item?
Posted: 11 Jun 2009 22:51
by admin
Mesh wrote:Actually, I've got another quick question... Would this command work for *any* context menu item? Or only ones handled by a DLL? The answer determines whether users need to scour the registry to figure it out before determining whether to use the script approach, or to use a UDC approach.
Any.