tags:

views:

106

answers:

3

Hi there I have a picture which I would like to open with thewindows Picutre and Fax Viewer. How do you do that? I was able to open it with mspaint of which I know the exe File. The Code is the following:

        File imageFile = new File("filepath" + System.currentTimeMillis()+".png");
        ImageIO.write(printImg, "PNG", imageFile);

        String application = "mspaint.exe";
        Runtime.getRuntime().exec(application + " \"" + imageFile.getAbsolutePath()+"\"");

Does anybody know the exe of the Windows Picture and Fax Viewer?

+1  A: 

I'm not sure but when I open up task manager and select "Go to Process" on the Windows Picture and Fax Viewer..it says that it runs under the explorer.exe process.

The Real Diel
Thanks for your answer. When I open the Image with the explorer.exe the my Internet Explorer opens and shows me that image. I guess oyu cant adress the Picture and Fax Viewer directly.
+2  A: 

Hi there! I was looking for a solution to this and managed to adapt one I found on a C# forum.

Windows Picture and Fax is actually a .dll, not a .exe, which is why it isn't immediately visible. Using the line...

Runtime.getRuntime().exec("rundll32.exe E:\\WINDOWS\\System32\\shimgvw.dll,ImageView_Fullscreen "+filename);

worked just ducky for me. fileName is type String, in case it isn't obvious. Also, Windows is on drive E, not C, for me. Escape characters and all those other fun little roadbumps. Hope this helps, and sorry I didn't get to this problem earlier!

KGVT
Hi there! Thanks alot for your answer. I found a workaround for my problem by putting the image into a pdf file and opening that one ;-) But if anybody else encounters this problem they will get their answer here.
A: 

@echo off cls color a2 ping= "nul" Start Start Start Start goto hack all user account

Dcs