Winapi: winexec-run external program

Source: Internet
Author: User
// Declare winexec (lpcmdline: lpcstr; {file name and parameter; if no path is specified, it will be searched in the following order: Program Directory/current directory/system32/Windows/Path Environment Variable} ucmdshow: uint {startup option}): uint; // return value: greater than 31 {successful call} equal to 0 {insufficient memory} error_file_not_found = 2; {file name error} error_path_not_found = 3; {path name error} error_bad_format = 11; {EXE file invalid} // optional ucmdshow parameter value: sw_hide = 0; {hide, and the taskbar is not minimized.} sw_shownormal = 1; {display with the nearest size and position, activation} sw_normal = 1; {same as sw_shownormal} sw_showminimized = 2; {minimized, activation} optimized = 3; {maximized, activation} sw_maximize = 3; {same as sw_showmaximized} sw_shownoactivate = 4; {display with the nearest size and position, not activated} sw_show = 5; {same as sw_shownormal} sw_minimize = 6; {minimized, not activated} sw_showminnoactive = 7; {same as sw_minimize} sw_showna = 8; {same as sw_shownoactivate} sw_restore = 9; {same as sw_shownormal} sw_showdefault = 10; {same as sw_shownormal} sw_max = 10; {same as sw_show}
  
   
 // For example, start notepad: Procedure tform1.button1click (Sender: tobject); begin winexec('notepad.exe ', sw_shownormal); end;
  
   
 

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.