title: FFplay successfully moved inside my Winform, how to set it borderless?
body: <p>with this code: <a href="https://stackoverflow.com/questions/14201894/show-a-tcp-video-stream-from-ffplay-ffmpeg-in-an-c-sharp-application">Show a tcp video stream (from FFPLAY / FFMPEG) in an C# application</a></p>
  
  <p>I successfully grabbed FFmpeg output inside my c# winform. By changing args is also possible to play video directly (without streaming)... here my complete (short) code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.Diagnostics;
  using System.Threading;
  using System.IO;
  using System.Reflection;
  using System.Runtime.InteropServices;
  using System.Drawing.Text;
  using System.Text.RegularExpressions;
  using System.Configuration;
  using Microsoft.Win32;
  using System.Windows.Forms.VisualStyles;
  
  namespace xFFplay
  {
      public partial class Form1 : Form
      {
          [DllImport("user32.dll", SetLastError = true)]
          private static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
  
          [DllImport("user32.dll")]
          private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
  
  
          //Process ffplay = null;
  
          public Form1()
          {
              InitializeComponent();
              Application.EnableVisualStyles();
              this.DoubleBuffered = true;
          }
  
          public Process ffplay = new Process();
          private void xxxFFplay()
          {
              // start ffplay 
              /*var ffplay = new Process
              {
                  StartInfo =
                  {
                      FileName = "ffplay.exe",
                      Arguments = "Revenge.mp4",
                      // hides the command window
                      CreateNoWindow = true,
                      // redirect input, output, and error streams..
                      //RedirectStandardError = true,
                      RedirectStandardOutput = true,
                      UseShellExecute = false
                  }
              };
               * */
                  //public Process ffplay = new Process();
                  ffplay.StartInfo.FileName = "ffplay.exe";
                  ffplay.StartInfo.Arguments = "Revenge.mp4";
                  ffplay.StartInfo.CreateNoWindow = true;
                  ffplay.StartInfo.RedirectStandardOutput = true;
                  ffplay.StartInfo.UseShellExecute = false;
  
              ffplay.EnableRaisingEvents = true;
              ffplay.OutputDataReceived += (o, e) =&gt; Debug.WriteLine(e.Data ?? "NULL", "ffplay");
              ffplay.ErrorDataReceived += (o, e) =&gt; Debug.WriteLine(e.Data ?? "NULL", "ffplay");
              ffplay.Exited += (o, e) =&gt; Debug.WriteLine("Exited", "ffplay");
              ffplay.Start();
  
              Thread.Sleep(500); // you need to wait/check the process started, then...
  
              // child, new parent
              // make 'this' the parent of ffmpeg (presuming you are in scope of a Form or Control)
              SetParent(ffplay.MainWindowHandle, this.Handle);
  
              // window, x, y, width, height, repaint
              // move the ffplayer window to the top-left corner and set the size to 320x280
              MoveWindow(ffplay.MainWindowHandle, 0, 0, 320, 280, true);
              
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              xxxFFplay();
          }
  
          private void Form1_FormClosed(object sender, FormClosedEventArgs e)
          {
              try { ffplay.Kill(); }
              catch { }
          }
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Unfortunately the FFmpeg output is with a standard BorderType but i need to have it borderless or, at least, without title bar and Minimize/Maximize/Close button.</p>
  
  <p>I really don't know Handles but as i can see i have a complete handle to the window:</p>
  
  <pre><code>MoveWindow(ffplay.MainWindowHandle, 0, 0, 320, 280, true);
  </code></pre>
  
  <p>Well, there is an easy way to remove FFplay borders?</p>
  
  <p>Thanks for your patience, i moved from Mplayer (super-easy to encapsulate inside WinForms) because it seem to be less compatible with certain files...</p>
  
  <p>Edit: I allready checked for FFplay options but there is not a 'borderless' one.</p>