#include <mmsystem.h> // winmm.lib
BOOL PlayMidi (char *sFileName)
{
char buf[256] ;
sprintf (buf, "open %s type sequencer alias MUSIC", sFileName) ;
if (mciSendString ("close all", NULL, 0, NULL) != 0)
{
return FALSE ;
}
if (mciSendString (buf, NULL, 0, NULL) != 0)
{
return FALSE ;
}
if (mciSendString ("play MUSIC from 0", NULL, 0, g_hWnd) != 0)
{
return FALSE ;
}
return TRUE ;
}