Go MFC Loads other applications

Source: Internet
Author: User

Three SDK functions winexec, shellexecute,createprocess can be used.
WinExec The simplest, two parameters, the previous specified path, and the latter specifies the display mode. The latter argument is worth saying
, such as mud with sw_showmaxmized way to add a program without maximizing the button, hehe is
Neterm,calc and so on, there will be no normal form, but it has been added to the task list.


ShellExecute more flexible than Winexex, you can specify the working directory, the following example is directly open
C:/temp/1.txt, instead of adding an application associated with a TXT file, many installers will open after completion
A window to display the Readme or FAQ, I guess this is the way to do it.
ShellExecute (null,null,_t ("1.txt"), null,_t ("C://temp"), sw_showmaxmized);

CreateProcess is the most complex, a total of 10 parameters, but most of them can be replaced with NULL, it can specify
The security properties of the process, the inheritance information, the class priority, and so on. Let's look at a very simple Example:
Startupinfo Stinfo; Information about the Startup window
ProcessInfo ProcInfo; Information about the process
CreateProcess (null,_t ("notepad.exe"), Null,null. FALSE, Normal_priority_
Class,null,null, &stinfo,&procinfo);

Go MFC Loads other applications

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.