Now I play correctly MP3 and WAV file with VLC. How can I check if there is an already running session of VLC and close it before playing a new file ?(without using Mutex)
Here's my code
int TfMain::play(char *filename)
{
const char *appname = "c:\\Program Files\\VideoLAN\\VLC\\vlc.exe";
STARTUPINFOA si;
PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
memset(&pi, 0, sizeof(pi));
char buf[MAX_PATH + 300];
wsprintfA(buf, "%s \"%s\" --play-and-exit", appname, filename);
CreateProcessA(0, buf, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
return 0;
}