468,773 Members | 2,517 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,773 developers. It's quick & easy.

receiving messages from mciSendString

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 ...

Nov 17 '05 #1
0 1192

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jeroen van Vliet | last post: by
reply views Thread by FRANCO | last post: by
3 posts views Thread by Mark Denardo | last post: by
reply views Thread by kbodily | last post: by
1 post views Thread by =?Utf-8?B?Q8Opc2Fy?= | last post: by
1 post views Thread by _nabuchodonozor | last post: by
6 posts views Thread by globalrev | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.