c# to vb.net application to control windows media player

swu

Active member
Joined
Mar 26, 2005
Messages
33
Programming Experience
1-3
Could someone assist me in converting this code to vb.net, I tried some of the online converters but it isn't translating well.

private System.Int32 iHandle;

private void btnStop_Click(object sender, System.EventArgs e)
{
Win32.SendMessage(iHandle, Win32.WM_COMMAND, 0x00004979, 0x00000000);
}

private void btnPlayPause_Click(object sender, System.EventArgs e)
{
Win32.SendMessage(iHandle, Win32.WM_COMMAND, 0x00004978, 0x00000000);
}

private void MainForm_Load(object sender, System.EventArgs e)
{
// get Window handle
iHandle = Win32.FindWindow("WMPlayerApp", "Windows Media Player");

Here's a link to the original article.

http://www.codeproject.com/csharp/wmp_pinvoke.asp

Thanks in advance!
}
 
Take the compiled code from that article and add a reference to the DLL. If you have visual studio, just add the C# solution to your VB project; the code debugger will step back and forth between the two languages without a care..
 
Back
Top