Recent

Author Topic: [Solved] How to add content to windows right click menu?  (Read 1653 times)

loaded

  • Hero Member
  • *****
  • Posts: 824
[Solved] How to add content to windows right click menu?
« on: July 19, 2022, 09:59:34 am »
Hi All,
I want to add content to right click menu in windows according to file extension.
If anyone has worked on the subject before, I would appreciate it if they could share their experiences. Respects.
« Last Edit: August 19, 2022, 01:31:37 pm by loaded »
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: How to add content to windows right click menu?
« Reply #1 on: July 19, 2022, 10:53:58 am »
https://docs.microsoft.com/en-us/previous-versions//bb776881(v=vs.85)?redirectedfrom=MSDN

I can help you if you can not Pascalify it yourself. ( There are for sure examples out there, btw)
Note this involves a shellextension and so on Windows 64 you need to write the extension in 64 bit too.
« Last Edit: July 19, 2022, 11:21:23 am by Thaddy »
Specialize a type, not a var.

loaded

  • Hero Member
  • *****
  • Posts: 824
Re: How to add content to windows right click menu?
« Reply #2 on: July 19, 2022, 12:50:22 pm »
Thank you very much for the reply, Master Thaddy.
I can help you if you can not Pascalify it yourself.
Thank you very much for your offer. I don't want to take up your precious time for this. The way you showed is good enough for me, I hope I can handle the rest. Respects.
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1312
    • Lebeau Software
Re: How to add content to windows right click menu?
« Reply #3 on: July 19, 2022, 08:10:00 pm »
You don't actually need to write a Shell Extension to accomplish this, unless you need to do some really advanced stuff (dynamic menus, owner-drawn menus, etc).  Otherwise, a few Registry keys is all you really need:

https://docs.microsoft.com/en-us/windows/win32/shell/context-menu
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: How to add content to windows right click menu?
« Reply #4 on: July 19, 2022, 09:04:18 pm »
You don't actually need to write a Shell Extension to accomplish this, unless you need to do some really advanced stuff (dynamic menus, owner-drawn menus, etc).  Otherwise, a few Registry keys is all you really need:

https://docs.microsoft.com/en-us/windows/win32/shell/context-menu
But that will give you an appearance and a no show.
Specialize a type, not a var.

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: How to add content to windows right click menu?
« Reply #5 on: July 19, 2022, 11:07:04 pm »
Remember that from Windows 11 these menu are by default hidden. You need to do other way for Windows 11.

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: How to add content to windows right click menu?
« Reply #6 on: July 20, 2022, 02:43:52 am »
Correct. You need more than a few registry keys.
Specialize a type, not a var.

loaded

  • Hero Member
  • *****
  • Posts: 824
Re: How to add content to windows right click menu?
« Reply #7 on: July 20, 2022, 07:02:56 am »
Thank you very much Remy Lebeau and lainz for your answer suggestions.

You don't actually need to write a Shell Extension to accomplish this, unless you need to do some really advanced stuff (dynamic menus, owner-drawn menus, etc).   
Yes, that's right, I just wanted to process a simple file extension.

Remember that from Windows 11 these menu are by default hidden. You need to do other way for Windows 11.
Yes, the classic behavior of windows  ;D
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1312
    • Lebeau Software
Re: How to add content to windows right click menu?
« Reply #8 on: July 20, 2022, 08:07:37 pm »
https://docs.microsoft.com/en-us/windows/win32/shell/context-menu
But that will give you an appearance and a no show.

I don't understand what you are saying.  But in any case, using just Shell registry keys, you can still make items for the right-click context menu. The items just may take more steps to reach in the menu (ie, using the "Show more options" item, or Shift-F10, etc), but the registry items are still accessible.

Remember that from Windows 11 these menu are by default hidden. You need to do other way for Windows 11.

According to references I saw, Windows 11 wants us to customize the context menu by implementing IExplorerCommand w/ an app identity (implementing IContextMenu as @Thaddy suggested is just as old as using Registry keys), or by using a Sparse manifest.  That is quite a bit more work just for simple menu items.
« Last Edit: July 20, 2022, 08:16:00 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

loaded

  • Hero Member
  • *****
  • Posts: 824
Re: How to add content to windows right click menu?
« Reply #9 on: August 19, 2022, 01:31:24 pm »
This is how I solved my problem indirectly though not directly.
https://wiki.freepascal.org/FileAssociation/fr
Check out  loaded on Strava
https://www.strava.com/athletes/109391137

 

TinyPortal © 2005-2018