override WndProc in a C# form

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 ...
 
Joined
Nov 8, 2006
Messages
1
Reaction score
0
Hello, im getting in troubles too with this signal catching
wallbash.gif
. May i ask you if you managed to solve your problem? If yes, how to do the trick ? Thanks in advance.

Have a nice day,
Jp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top