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