How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
Horst.Epp
Power Member
Power Member
Posts: 6950
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *Horst.Epp »

tomasf1 wrote: 2024-06-07, 14:05 UTC
ghisler(Author) wrote: 2024-06-07, 13:05 UTC Are you running Total Commander with higher user rights (As Administrator)? The function doesn't work in this case.
I open the program normally. I don't click run as administrator.
The question is not how to open the program.
It's how TC was started, with enhanced privs or not ?
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *Stefan2 »

tomasf1 wrote: 2024-06-07, 14:05 UTC
ghisler(Author) wrote: 2024-06-07, 13:05 UTC Are you running Total Commander with higher user rights (As Administrator)? The function doesn't work in this case.
I open the program normally. I don't click run as administrator.

- please use TC to go to "c:\Windows\"
- in "c:\Windows\"-folder, press the F7-key
- enter any word , like "test"
- press the Enter-key

Did the folder get created on you?




 
 
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *petermad »

2tomasf1

If TC is running as Administrator, you will see your Windows user name followed by an ^ in the titlebar
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
tomasf1
Junior Member
Junior Member
Posts: 4
Joined: 2024-06-05, 10:10 UTC

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *tomasf1 »

petermad wrote: 2024-06-07, 16:42 UTC 2tomasf1

If TC is running as Administrator, you will see your Windows user name followed by an ^ in the titlebar
No. There is no my user name with ^ in title bar.

Stefan2 wrote: 2024-06-07, 16:13 UTC
tomasf1 wrote: 2024-06-07, 14:05 UTC
ghisler(Author) wrote: 2024-06-07, 13:05 UTC Are you running Total Commander with higher user rights (As Administrator)? The function doesn't work in this case.
I open the program normally. I don't click run as administrator.

- please use TC to go to "c:\Windows\"
- in "c:\Windows\"-folder, press the F7-key
- enter any word , like "test"
- press the Enter-key

Did the folder get created on you?

No. When i try create folder in C:\Windows is popup window "Error direcotry not created" and is button to do this as administrator.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *petermad »

2tomasf1
No. There is no my user name with ^ in title bar.
No. When i try create folder in C:\Windows is popup window "Error direcotry not created" and is button to do this as administrator.
OK, That shows that you are not running TC in elevated state as administrator, so something else must be wrong in your system.

How exactly do you open an image file in TC? Double-click, Right-click menu, pressing F3 or F4?

Does it work as you expect when you double-click the file in Windows Explorer?
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
tomasf1
Junior Member
Junior Member
Posts: 4
Joined: 2024-06-05, 10:10 UTC

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *tomasf1 »

How exactly do you open an image file in TC? Double-click, Right-click menu, pressing F3 or F4?
In TC by Double-click or Enter.
Does it work as you expect when you double-click the file in Windows Explorer?
In Windows Explorer work fine - arrow keys is visible and possible to navigate to next image by arrow keys on keyboard or click arrows by mouse.
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *petermad »

arrow keys is visible and possible to navigate to next image by arrow keys on keyboard or click arrows by mouse.
Same here, ALSO when opened in TC with double-click/Enter - but I am on Windows 10
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *ghisler(Author) »

Here it also no longer works on Windows 11 now, probably due to a recent update of the Photos app. The same code still works on Windows 10, so apparently Microsoft has broken something in the Photos app. I thought that they may be blocking Desktop programs now, but then I tried the same code from a Windows Store app, and it also doesn't allow to switch between files in the Photos app.

Until recently it worked by setting the "NeighboringFilesQuery" option when launching the photos app. Example code for those who are interested:

Code: Select all

                    QueryOptions options = new QueryOptions();
                    options.ApplicationSearchFilter = "System.FileExtension:=(\".jpg\" OR \".png\")";
                    StorageFolder parent = await file.GetParentAsync();      // file is the StorageFile object to be launched
                    LauncherOptions launcherOptions = new LauncherOptions();
                    launcherOptions.NeighboringFilesQuery = parent.CreateFileQueryWithOptions(options);
                    ok = await Launcher.LaunchFileAsync(file, launcherOptions);
I have checked in the debugger, the query does return all the jpg and png files in the same directory. Launching the photos app this way on Windows 10 (and older Windows 11) allows to switch through all the images in the same folder. However, the new photos app on Windows 11 now seems to ignore this list.

Unfortunately I could not find out how the new photos app gets the list of files from Explorer.
Author of Total Commander
https://www.ghisler.com
yefkov
Junior Member
Junior Member
Posts: 4
Joined: 2019-03-15, 17:41 UTC

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *yefkov »

Until recently it worked by setting the "NeighboringFilesQuery" option when launching the photos app. Example code for those who are interested:
Try launching by uri instead of file:

Code: Select all

Uri uri = new Uri($"ms-photos:viewer?fileName={file.Path}");
await Launcher.LaunchUriAsync(uri);
https://learn.microsoft.com/en-us/windows/uwp/launch-resume/launch-default-app#photos-app-uri-scheme
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *ghisler(Author) »

That seems to work because it opens the photo viewer through Explorer. I still wonder how the Explorer is now passing the names to photo viewer with the old method removed.

It even works from the Total Commander command line or a button, e.g.
ms-photos:viewer?fileName=c:\path\file.jpg

However, it seems to require spaces encoded as %20, and accented characters in the name don't work at all. They probably need to be encoded somehow too...
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5743
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *white »

ghisler(Author) wrote: 2024-06-20, 09:58 UTC However, it seems to require spaces encoded as %20, and accented characters in the name don't work at all. They probably need to be encoded somehow too...
It says URI scheme, so obviously it needs to be URI encoded.
User avatar
Usher
Power Member
Power Member
Posts: 1726
Joined: 2011-03-11, 10:11 UTC

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *Usher »

ghisler(Author) wrote: 2024-06-20, 09:58 UTC However, it seems to require spaces encoded as %20, and accented characters in the name don't work at all. They probably need to be encoded somehow too...
Have you tried to use urlencoded paths and filenames for both spaces and accented characters?
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *ghisler(Author) »

Yes, converting to UTF-8 and then URL-encoding the string seems to work.
Author of Total Commander
https://www.ghisler.com
M10
Junior Member
Junior Member
Posts: 7
Joined: 2018-06-13, 17:06 UTC

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *M10 »

ghisler(Author) wrote: 2024-06-25, 15:39 UTC Yes, converting to UTF-8 and then URL-encoding the string seems to work.
Is that work-around going to be patched into TC soon? I'm on the latest public v11.03 and I can't get the Photos app to view the next image in a folder in TC without opening each one individually. Or is there a setting in TC 11.03's config to do just that?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50386
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How to change the default image viewer from "Windows Photo Viewer" to "Photos app"

Post by *ghisler(Author) »

Yes, it's in the public beta 11.50:
https://www.ghisler.com/1150_beta.htm
Author of Total Commander
https://www.ghisler.com
Post Reply