Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th March 2019, 23:01   #1  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Open with++ Shell Extension

Project page:

https://github.com/stax76/OpenWithPlusPlus

Last edited by stax76; 8th October 2019 at 00:56.
stax76 is offline   Reply With Quote
Old 16th March 2019, 10:51   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by stax76 View Post
If you are looking for freeware software which site do you go to?
I like FileHippo.

I recently wanted to find Windows v3.1 SDK and found it difficult to locate until I came upon "http://devel.archefire.org", where it resides along with much other stuff.
[A Liniux style repository, some preference to what looks like Italian (or maybe Spanish/Portuguese, as well as English).]
http://devel.archefire.org/files.php?file=/

EDIT: Here the SDK (get the 7z, the other is expanded files):- http://devel.archefire.org/files.php...indows/_TOOLS_
[Edit: In the SDK, can expand files ending in "_" via 7zip, they are CAB files, without the '.Cab' extension.]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 16th March 2019 at 11:11.
StainlessS is offline   Reply With Quote
Old 17th March 2019, 17:11   #3  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
The last couple of years I wasn't looking for software that much, the only site I visit from time to time is https://alternativeto.net where I submitted Open with++ as alternative for Open++.
stax76 is offline   Reply With Quote
Old 18th March 2019, 08:30   #4  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
There was a problem on Win 7 causing an error on startup, it's fixed in the latest realease. It has some minor new features and cosmetics included.

https://github.com/stax76/OpenWithPlusPlus
stax76 is offline   Reply With Quote
Old 8th October 2019, 01:02   #5  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
v2.0 is now available.

https://github.com/stax76/OpenWithPlusPlus

stax76 is offline   Reply With Quote
Old 8th October 2019, 01:07   #6  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
The forum software sucks for images and code on my setup, I've resized the image to 50% and still it breaks the page layout. I wish it could be fixed, most modern forum software don't have such kind of issue.

Last edited by stax76; 8th October 2019 at 01:11.
stax76 is offline   Reply With Quote
Old 8th October 2019, 18:59   #7  |  Link
BetA13
cosmic entity
 
BetA13's Avatar
 
Join Date: May 2011
Location: outside the Box
Posts: 258
hey stax76,

im not quite shure what exactly i can use this for.
Also, do you have an Description in German for this?

That would be very nice..

THX

Last edited by BetA13; 8th October 2019 at 21:29.
BetA13 is offline   Reply With Quote
Old 8th October 2019, 23:18   #8  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Hello BetA13,

it does allow you to customize the context menu in Windows File Explorer. You can create your own menu items and define when they are shown, how they are shown and what they do when you click on them, the short answer is it runs a command line so basic command line knowledge is required.

StaxRip executes command line tools so working on that I learned the basics but really never embraced the command line concept, I never bothered to learn windows batch scripting and never will. Also for staxrip I needed a player with a decent command line interface and mpv was really the only player having that, so I started to learn mpv and this finally after 20 years opened my eyes on how powerful the command line is, so I started to embrace the concept and get serious on learning powershell.

When they are shown

It means you can define for which type of file or folder they are shown. You can define that the menu is shown for all file extensions or only for certain file extensions or for directories.

Example Visual Studio Code:

It's a really amazing text/code editor, there are too many file extensions for text files so it makes sense to show the menu item of Visual Studio Code for all files, even for mkv etc. To do this you enter *.* in the File Types field. Visual Studio Code allows you also to open a folder, it is useful for many types of projects and languages but also for any type of text file. It has a find in files feature that will search for a string in all files of the opened folder including all sub folders. There are tools like File Locator Pro that can do that too but why install an extra tool if you already have one that can already do the job. What will also work for this task is PowerShell:

PS1> Get-ChildItem -Recurse | Select-String regex

Trash\rename.ps1:1:$pattern = Read-Host -Prompt "Enter a regex pattern"


PS1> gci -rec | sls regex

Trash\rename.ps1:1:$pattern = Read-Host -Prompt "Enter a regex pattern"

To show a menu item for folders in Open with++ check 'Show for directories', the menu item will be shows if you right-click a folder or a folder background. My full definition for VS Code is:

Name: Visual Studio Code
File Types: *.*
Path: C:\Program Files\Microsoft VS Code\Code.exe
Arguments: %paths%
Show for directories: checked

How they are shown

This means simply either on top level or in a submenu which is called: Open with++

My most often used menu commands are:

Visual Studio Code
PowerShell
Copy Paths

Since I use these menu command very often I show them on top level instead of in the 'Open with++' submenu, other more rarely used menu command such as mkvtoolnix gui, mpc-be, mpc-hc, mpv, staxrip, virtualdub2, vlc etc. are in my 'Open with++' submenu because I use these commands not so often. What is on top level because I use it often is MediaInfo, for that I have my own frontend:

Name: MediaInfo
File Types: %audio% %video% %subtitle% %image% (that are macros defined in the options dialog, these macros are used for all menu commands that deal with audio, video, subtitle and image files)
Path: D:\Projekte\VB\StaxRip\bin\StaxRip.exe
Arguments: -mediainfo %paths%

I made some improvements to my MediaInfo frontend in recent staxrip beta builds.

Currently I'm working hard on improving my PowerShell knowledge so I have a PowerShell menu command on top level, to show it I right click a folder or folder background and select the command in the menu. Windows has that built in by pressing shift key. The definition for my powershell menu command is:

Name: PowerShell
Path: powershell
Arguments: -nologo
Show for directories: checked

That's all because 'Open with++' will set the working directory to the directory of the selected files or folders. If you want to use ancient legacy tech that never was any good then you can show the command prompt with:

Name: CMD
Path: cmd
Show in submenu: checked
Show for directories: checked

Windows Terminal Preview can be used like so:

Name: Windows Terminal
Path: wt
Show for directories: checked

Windows Terminal does unlike cmd and powershell not start with the proper working directory but it has a setting to make it work: "startingDirectory" : null

https://www.microsoft.com/en-us/p/wi...ot:overviewtab

Very often the file or folder paths have to be copied to the clipboard, this is especially true if you code, because of that Windows has that built pressing shift before you open the context menu, I don't want to use the shift key all the time so I have my own menu command:

Name: Copy Paths
File Types: *.*
Path: powershell
Arguments: -file "D:\Projekte\PS1\copy paths.ps1" %paths%
Show for directories: checked
Run hidden: checked

'Run hidden' prevents the terminal to be shown, for this task it's not that useful. The -File switch of powershell tells powershell to run a powershell script, when the -File switch is used powershell will exit afterwards, this can be prevented with -noexit switch or in code with things like Pause or Read-Host. The %paths% macros will expand to the selected files and folders, in powershell it can be accessed with the $args variable. The full code needed for the Copy Paths menu command is pretty simple:

Code:
Set-Clipboard ($args -join "`r`n")
What they do when you click on them

It runs a command line, for that you define a Path and Arguments. ShellExecuteEx is used to run it. The shell extension is done with C++ as dotnet is not suitable for it. The selected files and folders are available in the %paths% macro, it expands to "file1" "folder1" etc. It expands environment variables in the Path and in the Arguments. You can define 'Run as admin' or if you only sometimes need something running as admin you can press shift or control.

Last edited by stax76; 9th October 2019 at 00:55.
stax76 is offline   Reply With Quote
Old 9th October 2019, 00:05   #9  |  Link
BetA13
cosmic entity
 
BetA13's Avatar
 
Join Date: May 2011
Location: outside the Box
Posts: 258
Oh dear... Thanks for the description
I do not understand it all, but i think i do know what you use it for now..
The example with staxrip was good..
I think i can use this for some stuff...

Thank you for this deep description with some examples, that really helped me understand it a bit better.

Downloading now...
Tomorow im gonna take it for a testdrive :P

Thanks again for taking the Time and explaining it in that depth...


Best Regards...
BetA13 is offline   Reply With Quote
Old 9th October 2019, 01:53   #10  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
You are welcome. What is the same topic is sometimes you want to delete context menu items that are defined in the Registry either by Windows or by an installed app. While it can be perfectly achieved with regedit it makes sense to do it with a powershell script. It's a relative easy task that is well suited to practice powershell. An example would be deleting the 'Edit with Paint 3D' menu item that is defined for jpg files. This can be achieved in one line:

Remove-Item "HKLM:\SOFTWARE\Classes\SystemFileAssociations\.jpg\Shell\3D Edit" -Force -Recurse

Saved in a powershell script (*.ps1) it can be executed every time Windows was installed. By default, ps1 files are opened with Visual Studio Code on my system, I find that the easiest way to execute a powershell script is using Open with++, for that I defined a menu command:

Name: Execute
File Types: ps1
Path: powershell
Arguments: -nologo -noexit -file %paths%

Also related is editing the New Menu, for that I coded a simple GUI app. This app is based on a brand-new and exciting platform called .NET Core 3.0, it is the successor of the .NET Framework, a brand that was discontinued in favor of the Core brand. Downside for users is that it's not yet part of the OS, but it will be in the future.

https://github.com/stax76/ShellNew
stax76 is offline   Reply With Quote
Old 14th October 2019, 03:27   #11  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
There was a bug in the search/filter feature, so I released a new version. I've also greatly improved the help content of the start page.

https://github.com/stax76/OpenWithPlusPlus
stax76 is offline   Reply With Quote
Old 14th October 2019, 07:36   #12  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
v3.0 fixes the terrible Win+X menu bug.

And the help content of the start page was further improved.

This tool is now complete.

https://github.com/stax76/OpenWithPlusPlus
stax76 is offline   Reply With Quote
Old 14th October 2019, 15:01   #13  |  Link
BetA13
cosmic entity
 
BetA13's Avatar
 
Join Date: May 2011
Location: outside the Box
Posts: 258
Thanks for the Update

*ThumbsUp*
BetA13 is offline   Reply With Quote
Old 14th December 2019, 23:52   #14  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
I get this error when i click Install. Dll is in folder.

redbtn is offline   Reply With Quote
Old 15th December 2019, 23:55   #15  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
What does it say in English?
stax76 is offline   Reply With Quote
Old 16th December 2019, 00:36   #16  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by stax76 View Post
What does it say in English?
Can't load OpenWithPPShellExtention.dll
redbtn is offline   Reply With Quote
Old 22nd March 2020, 05:41   #17  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
@redbtn

The issue has been fixed meanwhile.


@all

Maybe somebody can suggest SetMenuItemBitmaps C sample code or whatever else API is needed to add icon support, I would like to support ico and exe files as source.

Last edited by stax76; 22nd March 2020 at 05:48.
stax76 is offline   Reply With Quote
Old 22nd March 2020, 19:22   #18  |  Link
amichaelt
Guest
 
Posts: n/a
Quote:
Originally Posted by stax76 View Post
@redbtn

The issue has been fixed meanwhile.


@all

Maybe somebody can suggest SetMenuItemBitmaps C sample code or whatever else API is needed to add icon support, I would like to support ico and exe files as source.
This has example usages:

https://docs.microsoft.com/en-us/win...rc/using-menus
  Reply With Quote
Old 22nd March 2020, 20:06   #19  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Thanks, I can work with that. Probably more complicated than I expected but it's OK.
stax76 is offline   Reply With Quote
Old 25th March 2020, 10:15   #20  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
3.2.0.0 is available.

It supports icons using file types ICO, EXE and DLL, for EXE and DLL files a preview dialog shows asking for the index.

The working directory can be defined, previously this was always set to the directory of the selected files and folders.

Examples were improved, there is for instance one that shows how to execute a powershell script using the new Windows terminal.

https://github.com/stax76/OpenWithPl...ndows-terminal

Layout was improved.

Documentation was improved.

There is a Windows Terminal icon file included because wt.exe does not have one and the official one did not support the small menu size, I've saved it with IrfanView and after that it worked.


https://github.com/stax76/OpenWithPlusPlus
stax76 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.