I recently had a project that had to customize the WMP's GUI. Not only withing Settings area, but should be able to paint anywhere on the WMP. Still, the WMP should think that it's an UI plugin, and be able to load/unload it on users' prompt.
As WMP does not expose any functionality for repainting itself, I had to figure out some way on how to do this. I've managed to implement this with a hook procedure. It is a pretty raw method, I think, and you can run it some troubles with different versions of WMP, maybe you'll have to create version for your plugin for each version of WMP. The troubles may be causes because of different looks of different versions of WMP. (WMP 10 and WMP 11 for example). But this is a working solution, and I don't know of any other so here it goes.
When you're creating a UI plugin, WMP calls Create method of your plug-in. It looks something like this:
HRESULT CYourPlugin::Create(HWND hwndParent, HWND *phwndWindow);
So the first parameter you have a parent window for the plugin. Logically it would pretty obvious that the parent for the plug-in is a WMP window, itself. But that's not really like that. To get the player window you'll have to do something like this:
HWND thePlayerWnd = GetParent(GetParent(GetParent(GetParent(hwndParent))));
yeah, there are a lof of windows within the WMP. So once you have the player's window, you can set a hook to listen to the messages that it receives like this:
DWORD threadID = GetCurrentThreadId();
HHOOK hook SetWindowsHookEx(WH_CALLWNDPROCRET, (HOOKPROC) MyHookProc, AfxGetInstanceHandle(), threadID);
Then you just monitor the messages sent to hook procedure and handle them on your as you wish. (please note that in this case messages will be sent to you AFTER WMP had processed them. That's because of WH_CALLWNDPROCRET flag).
when your plugin is being unloaded don't forget to unhook:
UnhookWindowsHookEx(hook);
That's it.
more info on hooks can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks.asp
more info on WMP UI plugins here:
http://msdn2.microsoft.com/en-us/library/aa393418.aspx
If anybody has any question/suggestions please fill free to post them here.
Wednesday, December 13, 2006
Customizing Windows Media Player appierence with UI plug-in
Posted by
Shoniko
at
09:46
0
comments
Monday, December 11, 2006
GlooTV
Just got an email from the GlooTV team. Saying they are very excited about their new project and can't wait to let me beta test it. Can't say I'm that excited thooug:) Looks like another p2p streaming solution, but I'm not sure and still, it will be interesting to have a look at that!
If you're interested in beta testing it hurry up to http://GlooTV.com and register. Maybe you will still be among beta testers. And they will give free T-Shirts! Yey!:)
Posted by
Shoniko
at
15:14
0
comments
Sunday, December 10, 2006
VeniceProject
I've recently discovered the VenicePrject. That's the most mistified project ever! :) I wasn't able to find a thing about what it is exactly. Only that the guys who started Skype are behind it. They say it's something like p2p video streaming, but I know there are plenty p2p solutions available today already..like http://octoshape.com ..Well when Skype was starting there were already some VoIP messengers, so who knows..
If anybody is interested, you can start searching an info about the project here.
http://www.theveniceproject.com/
If you find anything, please post a comment here! I am really curiouse about it.
Posted by
Shoniko
at
19:29
2
comments
Labels:
Venice project p2p streaming "video sharing" media
DiggIt!
Del.icio.us
New stuff
Few cool things from the Media market I liked recently.
First - YouTube launches it's new feature - QuickCapture. (http://youtube.com/my_videos_quick_capture). It really looks like a great feature and I've been thinking a lot about something like this. In fact I'm currently implementing something like this. The funniest thing is that that Quick Capture page crashes on my laptop. :) It just starts downloading and then bam! I see the error message saying there was an error in my camera driver. I think it's worth to say that I'm using my QTek 8310 Smartphone as a camera:) but still, looks like YouTube didn't expect someone this.
Then the second thing is WPF/E CTP version. It's been released for a week or so already, and had a huge attention on WMTalk group. I have to say I LOVED it, even though it's only a CTP version and it loaded my CPU 87% just when watching the movie. You can find some cool samples of WPF/E here:
http://www.thewpfblog.com/
Cool thing is that it's able to co-exist with Flash. Like here:
http://thewpfblog.com/examples/wpfe/microbe/Default.html
More info on WPF/E here: http://msdn2.microsoft.com/en-us/library/bb190632.aspx
I've downloaded the WPF/E SDK, but for some reason didn't look at it yet. Well... I hope I will soon. The launch is expected in the first half of 2007 anyway;)
Posted by
Shoniko
at
15:22
0
comments
If you're posting you exist (neo Decart;)
Read that somewhere, so here I go. It's the start of my existence. Happy birthday to me!
Posted by
Shoniko
at
14:47
0
comments
Labels:
birthday Plato
DiggIt!
Del.icio.us