I posted a question on how to open a media file, now I want to know how I get the file to open w/ my program instead of Windows Media Player. Can someone help? If you could post the code here that would be helpful (P.S. I don't want to hide the Windows Media Player window, I want to make the file play w/ my program.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have this in one of my programs to play some wav files without using Media Player:
(in .rc file)
StartWave WAVE "start.wav"
StopWave WAVE "stop.wav"
(in main code)
PlaySound("StartWave", g_hInst, SND_RESOURCE | SND_ASYNC);
PlaySound("StopWave", g_hInst, SND_RESOURCE | SND_ASYNC);
Note that g_hInst is a global copy of the first argument, HINSTANCE, in WinMain(), which I'm sure is a bad way to do it but that's how the example was written and I didn't bother messing with it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I posted a question on how to open a media file, now I want to know how I get the file to open w/ my program instead of Windows Media Player. Can someone help? If you could post the code here that would be helpful (P.S. I don't want to hide the Windows Media Player window, I want to make the file play w/ my program.)
I have this in one of my programs to play some wav files without using Media Player:
(in .rc file)
StartWave WAVE "start.wav"
StopWave WAVE "stop.wav"
(in main code)
PlaySound("StartWave", g_hInst, SND_RESOURCE | SND_ASYNC);
PlaySound("StopWave", g_hInst, SND_RESOURCE | SND_ASYNC);
Note that g_hInst is a global copy of the first argument, HINSTANCE, in WinMain(), which I'm sure is a bad way to do it but that's how the example was written and I didn't bother messing with it.