title: How to set parameter type taken from variable
body: <p>For example this is what i need:</p>
  <pre><code>using System.Runtime.InteropServices;
  using System;
  
  public class Prog
  {
      public static Type myType = typeof(IntPtr);
  
      public static void Main() {
          var handle = new IntPtr(12345);
          SetForegroundWindow(handle);
      }
      [DllImport(&quot;user32.dll&quot;)]
      public static extern bool SetForegroundWindow(myType hWnd);
  }
  </code></pre>
  <p>How to write it down correctly? Visual studio underlines <strong>myType</strong> in method import.</p>