title: How to make a window active in vb.net
body: <p>So I'm working on a program that types into an open application that has no api. So I need to select that window so my program will type into it. I'm using this code and it can't find the proccess. </p>
  
  <pre><code>Dim windowHandle As IntPtr = FindWindow("LolClient", "League of Legends (TM) Client")
  Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As IntPtr
  SetForegroundWindow(windowHandle)
  
      SendKeys.SendWait("{TAB}")
      SendKeys.SendWait("{TAB}")
      SendKeys.SendWait("{TAB}")
      SendKeys.SendWait("{TAB}")
      SendKeys.SendWait("{TAB}")
      SendKeys.SendWait("{TAB}")
      SendKeys.SendWait("{TAB}")
      SendKeys.SendWait("{TAB}")
      SendKeys.SendWait(ComboBox1.Text)
      SendKeys.SendWait("{Enter}")
  </code></pre>