Recent

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

loaded

  • Hero Member
  • *****
  • Posts: 602
[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 »
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

Thaddy

  • Hero Member
  • *****
  • Posts: 11928
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 »
Black themes should be banned.

loaded

  • Hero Member
  • *****
  • Posts: 602
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.
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1144
    • 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: 11928
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.
Black themes should be banned.

lainz

  • Hero Member
  • *****
  • Posts: 3980
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: 11928
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.
Black themes should be banned.

loaded

  • Hero Member
  • *****
  • Posts: 602
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
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1144
    • 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: 602
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
If Ide=Lazarus 2.0.10 32 Bit and Os=Win 10 Home 64 Bit then Get up and do something useful! Because God is the helper of those who start again;

 

TinyPortal © 2005-2018