make media player

762 Views Asked by At

how can i add "using MCI;" in my c# project to make media player ??????

1

There are 1 best solutions below

1
On

First you need to import winmm.dll, it's found in "C:\WINDOWS\system32" The code in c# looks like this:

[DllImport("winmm.dll")]

After that you need to define option to send comands to mci. Use the following code:

private static extern long mciSendString(string command,StringBuilder returnValue,int returnLength,IntPtr winHandle);

After this you can start using previously defined command. It should look something like this:

mciSendString("open \"" + fileName + "\" type mpegvideo alias media", null, 0, IntPtr.Zero);

If you need any more help just ask (Sorry about bad english)