Sunday, 16 August 2015

[WINDOWS]KHÔI PHỤC TRÌNH XEM ẢNH PHOTO VIEWER TRÊN WINDOWS 10 (Đã bị ẩn)

If you are using Windows 10 operating system in your computer, you might have noticed that it doesn't come with "Windows Photo Viewer" program as default to open image files. Instead Windows 10 comes with a new modern (or metro) app called "Photos" which is now the default image viewer program in Windows 10.
Windows_10_Photos_App.png
Although new Photos app is a good looking program and provides good features and user interface but its not as fast as the good ol' "Windows Photo Viewer" program was. Photos app takes a little bit time in opening images or photo files which becomes quite annoying with time.
I never prefer modern or metro apps over traditional Desktop programs. So I decided to set "Windows Photo Viewer" as default image viewer in Windows 10.
When I checked in the new Settings app -> System -> Default Apps section, I couldn't find "Windows Photo Viewer" in the list given under "Photo viewer" selection. Only Photos app and Paint program were listed there. Microsoft has decided to not show the good ol' tool in default app selection list.
Windows_Photo_Viewer_Not_Listed_Default_Apps.png
After that I went to the classic "Set Default Programs" window in Control Panel hoping that I would be able to set "Windows Photo Viewer" as default image viewer from that tool. But for my surprise only 2 filetypes were listed to associate with "Windows Photo Viewer" program: TIF andTIFF. Again Microsoft has decided to remove all popular image filetypes from "Windows Photo Viewer" association screen so that no one can re-associate "Windows Photo Viewer" as default program to open those images in Windows 10.
Windows_Photo_Viewer_Default_Programs_Two_Filetypes.png
At last I decided to manually change the default program to open images by right-clicking on a .JPG file and selecting "Open with" option. Again "Windows Photo Viewer" was not present anywhere in the program list.
Windows_Photo_Viewer_Not_Listed_Open_With_List.png
It seems Microsoft has decided to completely ditch the good ol' "Windows Photo Viewer" program from Windows 10.
When I looked into my favorite Registry Editor program, I was able to find why "Windows Photo Viewer" program was not listed anywhere in Windows 10. Actually Microsoft has removed many required keys from Registry which were responsible to show "Windows Photo Viewer" in "Open with", "Default Apps" and "Set Default Programs" screens.
I opened Windows 8.1 OS in another machine and found the required keys in Registry Editor which were missing in Windows 10 OS and by adding those missing Registry keys to Windows 10, I was able to re-associate "Windows Photo Viewer" program with image files without any problem.
If you are also using Windows 10 and missing "Windows Photo Viewer" program and want to set it as default program to open image files in Windows 10, this tutorial will definitely help you.
There are actually 2 different cases:
CASE 1:
If you upgraded from Windows 7 or 8.1 to Windows 10, you might be able to see "Windows Photo Viewer" in "Open with", "Default Apps" and "Set Default Programs" screens. It happens because the required Registry keys are not removed during upgrade process. So if you upgraded your computer to Windows 10, you might be able to set "Windows Photo Viewer" as default program using "Open with", "Default Apps" or "Set Default Programs" screens.
CASE 2:
If you performed a clean installation of Windows 10, you'll not see "Windows Photo Viewer" program anywhere as mentioned in the starting of this article.
Now you have following 3 options to overcome this problem:
OPTION 1:
You can use a 3rd party image viewing utility such as IrfanView or XnView to replace Photos app in Windows 10. Many people might be already doing this. You can also use Microsoft's "Windows Live Photo Gallery" program which is quite similar to "Windows Photo Viewer".
OPTION 2:
You can set MS Paint program as default image viewer using Settings app -> System -> Default Apps page.
OPTION 3:
You can restore "Windows Photo Viewer" program functionality in Windows 10 with the help of following different methods:
  • METHOD 1: Create "Windows Photo Viewer" Direct Shortcut
  • METHOD 2: Add "Open With Windows Photo Viewer" Option in Image Files Context Menu
  • METHOD 3: Add "Windows Photo Viewer" Program in "Open With" List
  • METHOD 4: Associate All Image File Types to "Windows Photo Viewer" Program
NOTE 1: Method 1 and Method 2 are actually useful tips and can be used in other Windows versions as well.
NOTE 2: Method 3 and Method 4 are troubleshooting methods and should be used in Windows 10 only. Although if you are facing similar file association problems in previous Windows versions, you can use these two methods to fix the issue.
We'll start from basic methods to advanced methods. So without wasting time lets start the tutorial:
METHOD 1: Create "Windows Photo Viewer" Direct Shortcut
This is the most basic method! You can create a direct shortcut to launch "Windows Photo Viewer" program.
"Windows Photo Viewer" doesn't come with any executable (EXE) file. Its actually run by Windows using a DLL file "PhotoViewer.dll" present in "C:\Program Files\Windows Photo Viewer" folder. Obviously you can't run the program directly using the DLL file but you can take help of following command to launch "Windows Photo Viewer" directly:
rundll32 "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen
Its the command which is used everywhere in Windows Registry to address "Windows Photo Viewer" program's executable.
You can create a new shortcut on Desktop using the above mentioned command and it'll direct launch "Windows Photo Viewer" program.
But the program will launch empty and will not allow you to open any file. To overcome this issue, you can append full path of a particular image file or a folder containing your image files to the above mentioned command.
For example if you have a folder "Wallpapers" in E:\ drive containing all of your image files which you frequently open, you can create shortcut with following command:
rundll32 "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_FullscreenE:\Wallpapers
Now the shortcut will open with the first image file present in that folder and will allow you to browse through all image files using back and forward buttons or using arrow keys on your keyboard.
Windows_Photo_Viewer_Running_Windows_10.png
Also once you open an image file using this command, Windows will automatically add "Windows Photo Viewer" in "Open with" list and then you can set it as default for that image filetype.
METHOD 2: Add "Open With Windows Photo Viewer" Option for Image Files
You can also add a new option "Open with Windows Photo Viewer" in image files context menu. In other words, when you'll right-click on an image file, you'll get a new option "Open with Windows Photo Viewer" in the right-click menu. It'll help you in quickly open any image file with "Windows Photo Viewer" program.
Open_With_Windows_Photo_Viewer_Option_Image_Context_Menu.png
1. Press WIN+R keys together to open RUN dialog box. You can also open it from WIN+X menu. Now type regedit in RUN dialog box and press Enter. It'll open Registry Editor.
2. Now go to following key:
HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell
3. Create a new key under shell key and set its name to any desired string such as openwpv
4. In right-side pane, double-click on (Default) and change its value to Open with Windows Photo Viewer or any desired label which you want to see in right-click menu.
5. Now create a new key under openwpv key and set its name as command
6. In right-side pane, double-click on (Default) and change its value to as following:
%SystemRoot%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1
7. Now create one more new key under openwpv key and set its name as DropTarget
8. In right-side pane, create new string CLSID and set its value to {FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}
Adding_Open_With_Windows_Photo_Viewer_Option.png
That's it. Now you'll get a new option "Open with Windows Photo Viewer" in all image files context menu.
In future, if you want to remove the option, simply delete openwpv key from Registry.
PS: If you are not familiar with registry editing tasks, we are also providing ready-made registry script to do the task automatically for your convenience. Just download following ZIP file, extract it and then run the given .REG files to add or remove the option from context menu:
METHOD 3: Add "Windows Photo Viewer" Program in "Open With" List
Now some advanced methods!
"Windows Photo Viewer" doesn't show in "Open with" program list because Microsoft has removed an essential key "Open" from Registry which is responsible to show the program in Open with list.
We can re-add "Windows Photo Viewer" to "Open with" list by adding the Registry key again:
Windows_Photo_Viewer_Added_Open_With_List.png
1. Press WIN+R keys together to open RUN dialog box. You can also open it from WIN+X menu. Now type regedit in RUN dialog box and press Enter. It'll open Registry Editor.
2. Now go to following key:
HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell
3. Create a new key under shell key and set its name to open
4. In right-side pane, create new string MuiVerb and set its value to @photoviewer.dll,-3043
5. Now create a new key under open key and set its name as command
6. In right-side pane, double-click on (Default) and change its value to as following:
%SystemRoot%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1
7. Now create one more new key under open key and set its name as DropTarget
8. In right-side pane, create new string CLSID and set its value to {FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}
Adding_Windows_Photo_Viewer_Open_With_List.png
That's it. Now you'll get "Windows Photo Viewer" program in "Open With" list and then you can set it as default for that image filetype.
PS: If you are not familiar with registry editing tasks, we are also providing ready-made registry script to do the task automatically for your convenience. Just download following ZIP file, extract it and then run the given .REG file:
METHOD 4: Associate All Image File Types to "Windows Photo Viewer" Program
Now its turn of the last method which is the most advanced method and will bring full functionality of "Windows Photo Viewer" program in Windows 10 just like Windows 7/8/8.1.
When you try to set "Windows Photo Viewer" as default program for image files using classic "Set Default Programs" window in Control Panel, it only shows 2 filetypes to associate with this program: TIF and TIFF. So you can't associate "Windows Photo Viewer" with other filetypes.
It happens because Microsoft very cleverly removed the required keys from "Windows Photo Viewer" file associations capability in Registry.
But we can bring the full functionality of "Windows Photo Viewer" again in Windows 10 by re-adding those keys in Registry and it'll allow us to re-associate "Windows Photo Viewer" with all image filetypes again just like previous Windows versions.
Adding all these required Registry keys manually will take a lot of time, that's why we are providing a ready-made Registry script to add the keys automatically in Registry. Just download following ZIP file, extract it and then run the given .REG file:
The Registry script will first add all missing image filetypes such as BMP, GIF, PNG, JPEG, etc to following key in Registry Editor:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations
Adding_Filetypes_Windows_Photo_Viewer_Association.png
By default the above mentioned Registry key only contains .TIF and .TIFF strings. But as you can see in above screenshots, the Registry script has added other missing filetypes again.
Then the Registry script will perform the second part of this method!
I have seen many people are adding the missing filetypes in above mentioned Registry key with the same value as PhotoViewer.FileAssoc.Tiff for all which is incorrect. They don't know that they also need to add remaining keys in Registry such as PhotoViewer.FileAssoc.Bitmap, PhotoViewer.FileAssoc.Jpeg, PhotoViewer.FileAssoc.Png, etc to make them fully working. If we add the same PhotoViewer.FileAssoc.Tiff value for all strings, all image filetypes will show same icon in Explorer and we'll not be able to differentiate between BMP, GIF, JPG, PNG, etc filetypes. But if we follow the correct way and add different values for all filetype, all image filetype will show separate icons.
So the Registry script also adds other similar required keys to Registry which are as following:
HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Bitmap
HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Gif
HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.JFIF
HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Jpeg
HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Png
HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Wdp
Adding_Windows_Photo_Viewer_Filetype_Association_Registry_Keys.png
Once the Registry script adds the required keys, we'll be able to see all image filetypes listed for "Windows Photo Viewer" in "Control Panel -> Default Programs -> Set Default Programs" page.
Just select "Windows Photo Viewer" and click on "Set this program as default" button. Now Windows will set "Windows Photo Viewer" as default program for all image filetypes.
Set_Windows_Photo_Viewer_Default_Image_Viewer_Windows_10.png
You can check the filetypes list again by clicking on "Choose defaults for this program" button and now you'll see 12 image filetypes listed there including BMP, GIF, PNG, JPEG, etc.
If you go to Settings app -> System -> Default Apps page, you'll now see "Windows Photo Viewer" in the list given under "Photo viewer" selection.
Set_Windows_Photo_Viewer_Default_App_Windows_10.png
Some Interesting Info:
I found that in previous Windows versions, although Microsoft has put GIF filetype under "Windows Photo Viewer" file associations capability in Registry but Microsoft has not added the required "HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Gif" key in Registry. That's the reason why "Windows Photo Viewer" never gets associated with GIF filetype if you try to set it as default in classic "Set Default Programs" window in Control Panel. Whenever you click on "Set this program as default" button, "Windows Photo Viewer" associates with 11 filetypes always and never associates with GIF filetype. You can try and check it yourself in Windows 7/8/8.1.
To solve this issue, I have added the required "HKEY_CLASSES_ROOT\PhotoViewer.FileAssoc.Gif" key with correct information in Registry script and you'll be able to associate "Windows Photo Viewer" with all filetypes including GIF.
That's all for now. Feel free to share your feedback and suggestions in your comment...

[Leech về khi nào rảnh dịch sau :p)

No comments:

Post a Comment