Open the Windows Picture and Fax Viewer to open the picture, the relevant code is as follows:
Create a new system process
System.Diagnostics.Process Process = new System.Diagnostics.Process ();
Set the file name, here is the true path of the picture + file name
Process. Startinfo.filename = FileName;
This is a critical part. Sets the process run parameters, at which time the picture is displayed for the maximized window.
Process. startinfo.arguments = "Rundll32.exe c://windows//system32//shimgvw.dll,imageview_fullscreen";
This entry is not available if the shell is used to execute the program, because the system defaults to true, but if the setting must be true
Process. Startinfo.useshellexecute = true;
Here you can change the display style of the form that the process is open to without setting the
Process. Startinfo.windowstyle = System.Diagnostics.ProcessWindowStyle.Hidden;
Process. Start ();
Process. Close ();
The final process. The Close () method may not be written and can also be changed to process. WaitForExit () However, the latter will cause the program to pause until the open form is closed and the program will continue.
Original address: http://blog.csdn.net/jadeflute/article/details/5788168
C # calls Windows Picture and Fax Viewer to open a picture