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

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.