Using sndPlaySound to play a wave file!

This is how we do it… [sourcecode language=’cpp’]// Include file #include “mmsystem.h” // Link to this library #pragma comment( lib, “winmm.lib” ) int main( int argc, char **argv ) {     // Will block till the whole file is played, use SND_ASYNC to play asynchronously     sndPlaySound( “c://windows//media//ding.wav”, SND_SYNC );     // Play for ever, should use […]
Continue reading…

 

Opening and closing CD-Rom drive!

😀 Press the eject button buddy… Everybody knows that! Well what I meant was to do it programmatically, using windows api’s. 😉 Here is a simple function that does this… [sourcecode language=’cpp’]#pragma comment( lib, “winmm.lib” ) // Link to winmm.lib #include “mmsystem.h” // Include this file // Displays any error that has taken place void ShowMCIError( […]
Continue reading…