[vlc-devel] How to use the libvlc_media_player_set_hwndfunction?

brightown brightown at gmail.com
Fri Jul 3 16:28:49 CEST 2009

I used it like the example in the developer corner wiki show:


const char * const vlc_args[] = {
"-I", "dummy", /* Don't use any interface */
"--ignore-config", /* Don't use VLC's config */
"--plugin-path=D:\\bright\\test\\testlibvlc\\testlibvlc\\plugins\\" };
 m = libvlc_media_new (inst, "http://mycool.movie.com/test.mov", &ex);
 raise (&ex);

 mp = libvlc_media_player_new_from_media (m, &ex);
 raise (&ex);

 libvlc_media_release (m);

 libvlc_drawable_t drawable = (libvlc_drawable_t)GetDlgItem(IDC_STATIC_VIEW)->GetSafeHwnd(); 

 libvlc_media_player_set_hwnd(mp, drawable, &ex);    //replace the set_drawable function
 raise (&ex);

 ibvlc_media_player_play (mp, &ex);
 raise (&ex);


is it something wrong about these?
or forgot something in vlc_args ?
what is starting the playback mean?
Could you give a code example for using set_hwnd func in mfc?

Thanks for your reply~~~


发件人: Hugo Beauzee-Luyssen
发送时间: 2009-07-03 16:35:56
收件人: Mailing list for VLC media player developers
主题: Re: [vlc-devel] How to use the libvlc_media_player_set_hwndfunction?

2009/7/3 wei.tang <wei.tang at nufrontsoft.com>
> Hi
> I download the vlc 1.0.0rc4 and use the libvlc in my project, which is build on vs2008 mfc9.0.
> when I use libvlc_media_player_set_hwnd function in my simple dialog program , it can not work ,燾ould you give me some example or some advice to use this function?besides I see牋牋爈ibvlc_media_player_set_drawable?function is in deprecated?API , I also used?it in 0.9.9 it wouldn't work also. I think it must something wrong when I use them, Help me~~~THX!!!!
> Almost爁orgot爐o爏ay ,When I use libvlc_video_set_parent?func ,it works fine and the vlc player created in my dialog static controller, I do not know why~~~
This is exactly what I'm doing in my application...
libvlc_media_player_set_hwnd( media_player_instance, hwnd, vlc_exception );
Do you call this function before starting the playback ?
What's your application behavior when calling libvlc_media_player_set_hwnd ??
Hugo Beauz閑-Luyssen
vlc-devel mailing list
To unsubscribe or modify your subscription options:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090703/bd1ca0b8/attachment.html>

More information about the vlc-devel mailing list