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 29 30 31 32 33 34 35 36 37 38 39 40
|
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
char path[100] = "\"C:\\Program Files\\VideoLAN\\VLC\\";
printf("Lancement de VLC :\n");
HINSTANCE hint;
SHELLEXECUTEINFO sei = { 0 };
sei.cbSize = sizeof(sei);
sei.fMask = SEE_MASK_NOCLOSEPROCESS;
sei.hwnd = NULL;
sei.lpVerb = NULL;
sei.lpFile = "\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\"";
sei.lpParameters = "\"C:\\Program Files\\VideoLAN\\VLC\\nuts.avi\"";
sei.nShow = SW_SHOWDEFAULT;
sei.hInstApp = hint;
if(ShellExecuteEx(&sei) && hint > (HINSTANCE)32) printf("Lancement ok\n");
else printf("Erreur lancement\n");
printf("Appuyez sur q pour tuer VNC : ");
while (getchar() != 'q')
{
printf("Appuyez sur q pour tuer VNC : ");
while (getchar() != '\n')
continue;
}
TerminateProcess(sei.hProcess, 0);
CloseHandle(sei.hProcess);
return 0;
} |
Partager