HANDLE hMutex;
UnicodeString INSTANCE="sample";
hMutex=OpenMutex(MUTEX_ALL_ACCESS,false,UnicodeString("TABS_VIDEO_PLAYER_"+INSTANCE).w_str());
if (hMutex!=NULL) {
// Player already runing
}
system("C:\\TabsVideoPlayer\\TabsVideoPlayer.exe sample XXX \"Y:\\My files\\video\\sample.mkv\" 10 100 3600");
ShellExecute(Handle,L"open",UnicodeString("C:\\TabsVideoPlayer\\TabsVideoPlayer.exe").w_str(),"sample XXX \"Y:\\My files\\video\\sample.mkv\" 10 100 3600",NULL,SW_SHOWNORMAL);
We believe that the player is already running.
HANDLE hMapFile;
UnicodeString INSTANCE="sample",s ;
hMapFile=OpenFileMapping(FILE_MAP_ALL_ACCESS,FALSE,UnicodeString("TABS_VIDEO_PLAYER_DATA_"+INSTANCE).w_str());
if (hMapFile!=NULL) {
pBuf = (LPTSTR) MapViewOfFile(hMapFile,FILE_MAP_ALL_ACCESS,0,0,2002);
if (pBuf!=NULL) {
// Make parameters (Tab File [Speed] [Volume] [Position])
s="XXX \"Y:\\My files\\video\\sample.mkv\" 10 100 3600";
CopyMemory((PVOID)pBuf,s.w_str(),s.Length()*2+2); // Copy to shared memory
UnmapViewOfFile(pBuf);
}
CloseHandle(hMapFile);
}
Created with the Personal Edition of HelpNDoc: Free HTML Help documentation generator