Click here to Skip to main content
15,911,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello friends,

I am about to write a little code in VB NET that when I click a button labelled <Open>, it displays a JPEG image (stored on disk) using the "Windows Picture and Fax Windows".

So it comes down to right click on the file physically, then do "open with" and choose among the programs' "Windows Picture and Fax Windows".

Here is the snippet I plugged in my button click event and It did not work as expected:

VB
'An instance of the Process class
Sun proc As New System.Diagnostics.Process ()
Name of the executable to launch
proc.StartInfo.FileName = "c: \ windows \ system32 \ shimgvw.dll"
'Arguments to pass to the executable to launch
proc.StartInfo.Arguments = "c: \ test.jpg"
'Start the process
proc.Start ()
'It frees resources that are needed most.
proc.Close () 'Warning Close does not terminate the process.
Posted
Updated 25-Oct-10 1:08am
v2
Comments
Dalek Dave 25-Oct-10 7:09am    
Edited for Readability and Code Block correction.

1 solution

You can put your image path instead of C:\8617.png

VB
Shell("rundll32.exe shimgvw.dll,ImageView_Fullscreen C:\8617.png")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900