title: How to change the title text of Visual Studio 2017
body: <p>I am trying to add VS extension that will change the title bar text. I found the tools, but I need it in my extension.</p>
  
  <p>I tried:</p>
  
  <pre><code>var dte = GetServiceAsync(typeof(DTE)) as DTE2;
  if(!(dte is null))
      dte.MainWindow.Caption = "Name";
  </code></pre>
  
  <p>but it doesn't work.</p>
  
  <p>Similarly,</p>
  
  <pre><code>[DllImport("user32.dll")]
  private static extern bool SetWindowText(IntPtr hWnd, string lpString);
  
  var proc = Process.GetCurrentProcess();
  SetWindowText(proc.MainWindowHandle, "Name);
  </code></pre>
  
  <p>just changes the <code>Process.MainWindowTitle</code></p>