C # calls Windows Picture and Fax Viewer to open a picture

Source: Internet
Author: User

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

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

11.11 Big Sale for Cloud

Get Unbeatable Offers with up to 90% Off,Oct.24-Nov.13 (UTC+8)

Get It Now >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.