title: HWND from Spy++ Window Handle
body: <p>Spy++ gives you the hex value of a window handle. I am want to take in this number value and create the <code>HWND</code> from that value but I can't seem to figure out how to do that.</p>
  
  <p>This is what I have tried:</p>
  
  <pre><code>_tprintf(_T("What is the window handle?\r\n")); 
  
  HWND hWnd;
  _tscanf(_T("%x"), &amp;hWnd);   
  
  if(!IsWindow(hWnd))
  {
      _tprintf(_T("This is not a window\r\n"));
  }
  else
  {
      _tprintf(_T("This is a window\r\n"));
  }
  </code></pre>
  
  <p>What am I doing wrong? Or am I misunderstand something?</p>