How do I create a KB shortcut for a Context Menu item?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

How do I create a KB shortcut for a Context Menu item?

Post 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...).

admin
Site Admin
Posts: 66324
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How do I create a KB shortcut for a Context Menu item?

Post by admin »

If you mean the Shell context menu: no way.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: How do I create a KB shortcut for a Context Menu item?

Post 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?

admin
Site Admin
Posts: 66324
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How do I create a KB shortcut for a Context Menu item?

Post 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.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: How do I create a KB shortcut for a Context Menu item?

Post 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...

admin
Site Admin
Posts: 66324
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How do I create a KB shortcut for a Context Menu item?

Post 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.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: How do I create a KB shortcut for a Context Menu item?

Post 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. :)

admin
Site Admin
Posts: 66324
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How do I create a KB shortcut for a Context Menu item?

Post 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.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: How do I create a KB shortcut for a Context Menu item?

Post 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.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: How do I create a KB shortcut for a Context Menu item?

Post 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. :)

admin
Site Admin
Posts: 66324
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How do I create a KB shortcut for a Context Menu item?

Post 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.

Post Reply