C# .NET Windows Media Player WM_COPYDATA *whimper*
-
Well, let me get my situation explained. Before I go any further please know I HAVE google'd, so much so that I'm posting on a forum after a few hours of searching :). Sticking to the point, I'm basically trying to aquire the current media info from windows media player and retrieve the value in a .NET application. My apologies for the amount of links. I first found the COM refrence named wmp.dll, after a reasonable amount of time wasted, I realised that it was used for embedding WMP in a form application etc, which isn't what I wanted. Next I hit google, nothing. IRC followed with everyone shrugging, one individual did however suggest I look at a IM plugin source code. After that I found the following file written in what I think looks like C (http://pidgin-musictracker.googlecode.com/svn/trunk/src/wmp.c[^). Reading through the plugin wiki revealed the following page, (http://kentie.net/article/nowplaying/index.htm[^]). I learned that the wmp live messenger plugin sent its data via WM_COPYDATA (still not too sure on how that works :D), following on from that... I then landed on the following link which seemed very promising at first (http://www.codeproject.com/KB/cs/wm_copydata_use.aspx[^]). I downloaded the source & binaries and sure enough the data was 'magically' been sent between programs, I thought to myself.. thats how WMP does it! :) After reading the source, I was stumped... probably due to my lack of knowlage and experience. Could some 'kind' individual(s) aid me in these troubles I am having. Kind Regards Sam
-
Well, let me get my situation explained. Before I go any further please know I HAVE google'd, so much so that I'm posting on a forum after a few hours of searching :). Sticking to the point, I'm basically trying to aquire the current media info from windows media player and retrieve the value in a .NET application. My apologies for the amount of links. I first found the COM refrence named wmp.dll, after a reasonable amount of time wasted, I realised that it was used for embedding WMP in a form application etc, which isn't what I wanted. Next I hit google, nothing. IRC followed with everyone shrugging, one individual did however suggest I look at a IM plugin source code. After that I found the following file written in what I think looks like C (http://pidgin-musictracker.googlecode.com/svn/trunk/src/wmp.c[^). Reading through the plugin wiki revealed the following page, (http://kentie.net/article/nowplaying/index.htm[^]). I learned that the wmp live messenger plugin sent its data via WM_COPYDATA (still not too sure on how that works :D), following on from that... I then landed on the following link which seemed very promising at first (http://www.codeproject.com/KB/cs/wm_copydata_use.aspx[^]). I downloaded the source & binaries and sure enough the data was 'magically' been sent between programs, I thought to myself.. thats how WMP does it! :) After reading the source, I was stumped... probably due to my lack of knowlage and experience. Could some 'kind' individual(s) aid me in these troubles I am having. Kind Regards Sam
It would help if you kindly stated your exact question so that someone could know how to help you. Are you trying to implement the WM_COPYDATA in your C# program?
-
It would help if you kindly stated your exact question so that someone could know how to help you. Are you trying to implement the WM_COPYDATA in your C# program?
-
My apologies :P Yes, I'm trying to impliment WM_COPYDATA into my C# .NET program, however it needs to get the data sent by wmplayer.exe rather than another application that I have written. Thanks
Hi, It appears that you have two problems, basically. 1. How to implement the reception of the WM_COPYDATA message in your C# program - this I can help you with 2. How to make Media Player send you the information - this I have no idea. As far as #1, you'll have to create and manage a window for the sole purpose of receiving window messages of which WM_COPYDATA is just one. Look up this topic in MSDN
"Subclassing Controls with a Managed Window Procedure"
. The idea is that you hijack the window procedure for one of your controls, and handle the low-level window messages in your C# program instead of letting the control handle them itself. This is pretty tough stuff, but if you have further questions, I'm sure that I or someone else can answer them. -
Hi, It appears that you have two problems, basically. 1. How to implement the reception of the WM_COPYDATA message in your C# program - this I can help you with 2. How to make Media Player send you the information - this I have no idea. As far as #1, you'll have to create and manage a window for the sole purpose of receiving window messages of which WM_COPYDATA is just one. Look up this topic in MSDN
"Subclassing Controls with a Managed Window Procedure"
. The idea is that you hijack the window procedure for one of your controls, and handle the low-level window messages in your C# program instead of letting the control handle them itself. This is pretty tough stuff, but if you have further questions, I'm sure that I or someone else can answer them.