You could try this -
I couldn't find it on the latest MSDN (it was on an older version), and haven't tried it so don't know it it works but you could try calling it from your WM_CREATE message handler.
Function: PlayMidi() // // Purpose: Plays a midi file
BOOL PlayMidi(char *sFileName)
sprintf(buf, "open %s type sequencer alias MUSIC", sFileName);
if (mciSendString("close all", NULL, 0, NULL) != 0)
if (mciSendString(buf, NULL, 0, NULL) != 0)
if (mciSendString("play MUSIC from 0", NULL, 0, g_hWnd) != 0)