C ++ builder winexecandwait

Source: Internet
Author: User

After prompts and help from QQ group and Forum users, the executable version was finally modified.

 

Long _ fastcall tfrmmain: winexecandwait (ansistring acmdline, int visibility) <br/>{</P> <p> char zappname [512]; </P> <p> process_information processinfo = {0}; </P> <p> startupinfo = {sizeof (startupinfo)}; // initialization, set the first value to 0 or null </P> <p> memset (zappname, 0, sizeof (zappname )); <br/> strcpy (zappname, acmdline. c_str (); </P> <p> startupinfo. dwflags = startf_useshowwindow; <br/> startupinfo. wsho Wwindow = visibility; <br/> // startupinfo. wshowwindow: = sw_normal; <br/> // startupinfo-> wshowwindow = sw_hide; </P> <p> If (! CreateProcess (null, zappname, null, null, false, 0, null, null, & startupinfo, & processinfo) <br/>{< br/> return-1; <br/>}< br/> else <br/> {<br/> unsigned long result = 0; <br/> waitforsingleobject (processinfo. hprocess, infinite); <br/> getexitcodeprocess (processinfo. hprocess, & result); <br/> return result; <br/>}</P> <p>

 

 

PS: In the QQ Group, a netizen "Migrant Worker Yi" gave me the greatest help. His familiarity with C ++ MFC and debugging methods made me feel deeply, unfortunately, he now only has a high school diploma, and many resumes have been submitted, and he has no interview opportunities.

 

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.