Article View: borland.public.cppbuilder.nativeapi
Article #8575Re: ShellExecute
From: JF Jolin
Date: Sun, 17 Oct 2004 05:31
Date: Sun, 17 Oct 2004 05:31
43 lines
2366 bytes
2366 bytes
Sorry for the messy look. I hope this one will be fine.
You could have a much better control over executable launching with
CreateProcess()
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation;
BOOL bProcessOk;
memset(&StartupInfo, 0, sizeof(STARTUPINFO));
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_SHOWNORMAL;
memset(&ProcessInformation, 0, sizeof(PROCESS_INFORMATION));
/*
Parameters Information for CreateProcess
pointer to name of executable module pointer to command line string
pointer to process security attributes
pointer to thread security attributes
handle inheritance flag
creation flags
pointer to new environment block
pointer to current directory name
pointer to STARTUPINFO
pointer to PROCESS_INFORMATION
*/
bProcessOk = CreateProcess(
(LPCTSTR) NULL,
(LPTSTR) szCommand,
(LPSECURITY_ATTRIBUTES) NULL,
(LPSECURITY_ATTRIBUTES) NULL,
(BOOL) TRUE,
(DWORD) CREATE_NEW_CONSOLE |
NORMAL_PRIORITY_CLASS,
(LPVOID) NULL,
(LPCTSTR) NULL,
(LPSTARTUPINFO) &StartupInfo,
(LPPROCESS_INFORMATION) &ProcessInformation);
--
JF Jolin
[Montreal, Canada]
Technical Details
Message-ID:
<opsfz1m71qz6rw7b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<416febd4$1@newsgroups.borland.com> <opsfztbx0ez6rw7b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,345bff3d3bc63eb6 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: ShellExecute References: <416febd4$1@newsgroups.borland.com> <opsfztbx0ez6rw7b@newsgroups.borland.com> Message-ID: <opsfz1m71qz6rw7b@newsgroups.borland.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed From: JF Jolin <jfj@nospam.com> MIME-Version: 1.0 Date: Sun, 17 Oct 2004 01:31:45 -0400 User-Agent: Opera7.11/Win32 M2 build 2887 NNTP-Posting-Host: 66.158.146.164 X-Trace: newsgroups.borland.com 1097991108 66.158.146.164 (16 Oct 2004 22:31:48 -0700) Lines: 43 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail