1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| ShellExecute(NULL,
"open",
"D:\\Bare\\Positions\\Bras3OuvrePince.exe",
NULL,
NULL,
SW_SHOWNORMAL);
printf( "CreateProcess failed (%d).\n", GetLastError() );
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
0, // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
// Process any inserts in lpMsgBuf.
// ...
// Display the string.
printf("%s",(LPCTSTR)lpMsgBuf);
// Free the buffer.
LocalFree( lpMsgBuf ); |
Partager