How to prevent "External Editor" from launching a new editor

Hello all FastPictureViewer users,
I've recently found this highly useful and extremely well crafted tool. However, I found it somewhat limiting that the "External Editor" function always opens a new instance of my preferred photo editor "COREL Photo-Paint X4" (which seemingly can't be configured to prevent multiple instances). After much experimentation I've finally found a solution, which I'd like to share.
The solution consists of three parts:
1. A registry modification which adds an "Edit" action to the context menu for .jpg files in Windows Explorer. This action opens the image in Photo-Paint, after starting it if necessary.
2. An old style batch file, called by FPV.
3. A Windows PowerShell script, called by the batch file, which uses DDE to open the image in Photo-Paint.
The reason for the intermediate batch file is, that by default a PowerShell opens with Notepad (which is a good thing, from a security perspective). The batch file is executed, however, which is what we want.
The following code works on my Windows 7 computer for .jpg files and Photo-Paint, but should also work on your computer for other file types and editors after some fiddling.
1. Create three new Registry keys:
2. The batch file "pp.bat", which is launched from FastPictureViewer by pressing ctrl+F1:
3. The PowerShell script:
I'm looking forward to being able to buy a full license, and the codec pack!
I've recently found this highly useful and extremely well crafted tool. However, I found it somewhat limiting that the "External Editor" function always opens a new instance of my preferred photo editor "COREL Photo-Paint X4" (which seemingly can't be configured to prevent multiple instances). After much experimentation I've finally found a solution, which I'd like to share.
The solution consists of three parts:
1. A registry modification which adds an "Edit" action to the context menu for .jpg files in Windows Explorer. This action opens the image in Photo-Paint, after starting it if necessary.
2. An old style batch file, called by FPV.
3. A Windows PowerShell script, called by the batch file, which uses DDE to open the image in Photo-Paint.
The reason for the intermediate batch file is, that by default a PowerShell opens with Notepad (which is a good thing, from a security perspective). The batch file is executed, however, which is what we want.
The following code works on my Windows 7 computer for .jpg files and Photo-Paint, but should also work on your computer for other file types and editors after some fiddling.
1. Create three new Registry keys:
- Code: Select all
HKEY_CLASSES_ROOT\SystemFileAssociations\.jpg\Shell\edit\command
"D:\local\Corel\CorelDRAW-Graphics-Suite-X4\Programs\CorelPP.exe" -DDE
HKEY_CLASSES_ROOT\SystemFileAssociations\.jpg\Shell\edit\ddeexec
[open("%1")]
HKEY_CLASSES_ROOT\SystemFileAssociations\.jpg\Shell\edit\ddeexec\application
CORELPP
2. The batch file "pp.bat", which is launched from FastPictureViewer by pressing ctrl+F1:
- Code: Select all
@ECHO OFF
ECHO Opening image in COREL Photo-Paint...
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe E:\etc\powershell-home\scripts\pp.ps1 %1
3. The PowerShell script:
- Code: Select all
# this uses DDE, so if Photo-Paint is already running the image will be opened there
start-process -verb edit $args[0]
I'm looking forward to being able to buy a full license, and the codec pack!