Click here to Skip to main content
16,021,569 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am making a media player using VLC. I designed a winform in c# project and using P/invoke to use the function "libvlc_media_player_set_hwnd". The media could be played. But it could not be seen that the butten I put in the player. I would like there is a butten. What should I do?

Here is my code.
 public Form1()
 {
     InitializeComponent();
     int res = VLC.VLC_load(Player.Handle);
 }
 private void button1_Click(object sender, EventArgs e)
 {
 int res = VLC.VLC_play("D:\\tmp2\\3.rmvb");
 }


public static class VLC
	{
		[DllImport("MagicPlayer.dll")]
		public extern static int VLC_load(IntPtr window);

		[DllImport("MagicPlayer.dll")]
        public extern static int VLC_go_back_to_last_stop();

		[DllImport("MagicPlayer.dll")]
        public extern static int VLC_pause();

		[DllImport("MagicPlayer.dll")]
        public extern static int VLC_play(string fileName);
        
        [DllImport("MagicPlayer.dll")]
        public extern static int VLC_release();
	}


It can run. But when I put the butten into the the Player which is a panal. It can't be seen.
Posted
Updated 17-May-14 20:31pm
v3

1 solution

Hello Water,

The question from you is how to insert button in winform.Here you go refer this
Hello C++/CLI - Part 1[^]

Other wise pls start writing better understandable questions with your code,So that others can help you out:)All the best:)
 
Share this answer
 
Comments
Water1988 18-May-14 2:22am    
Thank you for your answer. And I'm sorry for my question. It is not clear. andI will ask it clear and with my coad

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900