Sending a Command

The following example function sends the play command with the "from" and "to" flags.

DWORD PlayFromTo(LPSTR lpstrAlias, DWORD dwFrom, DWORD dwTo) 
{ 
    char    achCommandBuff[128]; 
    wsprintf(achCommandBuff, "play %s from %u to %u", 
        lpstrAlias, dwFrom, dwTo); 
    return mciSendString(achCommandBuff, NULL, 0, NULL); 
}