getting number of items from curr playlist of windows media player
- From: Paul Fi <nazar_fin@xxxxxxxxxxx>
- Date: Sat, 14 Jan 2006 03:07:30 -0800
I have this code which tries to obtain the number of items in the
current playlist of windows media player:
private void MainForm_Load(object sender, System.EventArgs e)
{
// get Window handle
wnd = Win32.FindWindow("WMPlayerApp","Windows Media Player");
wnd = Win32.FindWindowEx(wnd, 0, "WMPAppHost", null);
wnd = Win32.FindWindowEx(wnd, 0, "WMP Skin Host", null);
wnd = Win32.FindWindowEx(wnd, 0, "CWmpControlCntr", null);
wnd = Win32.FindWindowEx(wnd, 0, "WMPPlaylist", null);
wnd = Win32.FindWindowEx(wnd, 0, "ATL:SysListView32", null);
iHandle = Win32.FindWindow("WMPlayerApp", "Windows Media Player");
}
private void button1_Click(object sender, System.EventArgs e)
{
han =Win32.SendMessage(wnd, Win32.LB_GETCOUNT, 0,0);
if(han != Win32.LB_ERR)
{
textBox1.Text = Convert.ToString(han);
}
}
so when i click the button1 i should get the number of items displayed
in my textbox1.
but all i get is 0 even though my current playlist has 5 items and one
of them is currently playing.
has any body any idea why this is happening?
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: getting number of items from curr playlist of windows media player
- From: Vadym Stetsyak
- Re: getting number of items from curr playlist of windows media player
- Prev by Date: Re: How to set culture in the application?
- Next by Date: Re: O/R Mapper
- Previous by thread: Problem with TestOut's C# For Programmers
- Next by thread: Re: getting number of items from curr playlist of windows media player
- Index(es):