|
-
July 28th, 1999, 02:24 AM
#1
Launch app from app
Hi,
I would like to launch another app from my program. How can I do this ?
(Devstudio, MFC app)
Thanks !
PUH
-
July 28th, 1999, 02:33 AM
#2
-
July 28th, 1999, 02:58 AM
#3
Re: Launch app from app
If app you want to launch requires parameters:
char str[] = app_to_launch + parameters
STARTUPINFO startup;
PROCESS_INFORMATION process;
memset( &startup, 0, sizeof( startup ) );
startup.cb = sizeof( startup );
memset( &process, 0, sizeof( process ) );
BOOL tSuccess = CreateProcess( NULL, str, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &process );
HWINSTA sta = GetProcessWindowStation();
if( tSuccess )
{
// Close the handles that CreateProcess returned so we don't leak
// kernel resources.
ASSERT( process.hProcess != NULL );
CloseHandle( process.hProcess );
ASSERT( process.hThread != NULL );
CloseHandle( process.hThread );
}
If not have parameters
CString str = app_to_launch
.............
BOOL tSuccess = CreateProcess( str, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &process );
.......................
hope this help you
Regards,
Ovidiu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|