H
han.phony
Hi, I am trying to intercept the message sent back by winmm.dll's
mciSendString method when playback is finished. I tried to override the
WndProc in the form but I didn't get/intercept the message, here is the
code fragment:
public const int MM_MCINOTIFY = 953;
public const int MM_NOTIFY_ABORTED = 4;
public const int MCI_NOTIFY_FAILURE = 8;
public const int MCI_NOTIFY_SUCCESSFUL = 1;
public const int MCI_NOTIFY_SUPERSEDED = 2;
public const int GWL_WNDPROC = -4;
protected override void WndProc(ref Message m)
{
if ( m.Msg == MCITest.MM_MCINOTIFY )
{
string stuff = "xxx";
switch ( m.WParam.ToInt32() )
{
case MCITest.MCI_NOTIFY_SUCCESSFUL:
this.mediaStatus = (int) MCITest.playStatus.FINISHED;
stuff = "Finished Successfully!";
break;
case MCITest.MCI_NOTIFY_FAILURE:
this.mediaStatus = (int) MCITest.playStatus.FAILURE;
stuff = "Finished Failure!";
break;
case MCITest.MM_NOTIFY_ABORTED:
this.mediaStatus = (int) MCITest.playStatus.ABORTED;
stuff = "Finished Aborted!";
break;
case MCITest.MCI_NOTIFY_SUPERSEDED:
this.mediaStatus = (int) MCITest.playStatus.SUSPENDED;
stuff = "Finished Suspended!";
break;
default:
stuff = "Default!";
break;
}
System.Diagnostics.Debug.WriteLine ("Stuff -> " + stuff);
base.WndProc (ref m);
}
System.Diagnostics.Debug.WriteLine ("Msg -> " + m.Msg);
base.WndProc (ref m);
}
Any help is greatly appreciated ...
mciSendString method when playback is finished. I tried to override the
WndProc in the form but I didn't get/intercept the message, here is the
code fragment:
public const int MM_MCINOTIFY = 953;
public const int MM_NOTIFY_ABORTED = 4;
public const int MCI_NOTIFY_FAILURE = 8;
public const int MCI_NOTIFY_SUCCESSFUL = 1;
public const int MCI_NOTIFY_SUPERSEDED = 2;
public const int GWL_WNDPROC = -4;
protected override void WndProc(ref Message m)
{
if ( m.Msg == MCITest.MM_MCINOTIFY )
{
string stuff = "xxx";
switch ( m.WParam.ToInt32() )
{
case MCITest.MCI_NOTIFY_SUCCESSFUL:
this.mediaStatus = (int) MCITest.playStatus.FINISHED;
stuff = "Finished Successfully!";
break;
case MCITest.MCI_NOTIFY_FAILURE:
this.mediaStatus = (int) MCITest.playStatus.FAILURE;
stuff = "Finished Failure!";
break;
case MCITest.MM_NOTIFY_ABORTED:
this.mediaStatus = (int) MCITest.playStatus.ABORTED;
stuff = "Finished Aborted!";
break;
case MCITest.MCI_NOTIFY_SUPERSEDED:
this.mediaStatus = (int) MCITest.playStatus.SUSPENDED;
stuff = "Finished Suspended!";
break;
default:
stuff = "Default!";
break;
}
System.Diagnostics.Debug.WriteLine ("Stuff -> " + stuff);
base.WndProc (ref m);
}
System.Diagnostics.Debug.WriteLine ("Msg -> " + m.Msg);
base.WndProc (ref m);
}
Any help is greatly appreciated ...