title: getting a specific window name in c++
body: <p>I use this code to get the window name:</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  #include &lt;stdio.h&gt;
  
  int main() {
      TCHAR title[500];
      int i=0;
      while(i&lt;10) {
          GetWindowText(GetForegroundWindow(), title, 500);
          printf("%s\n",title);
          i++;
          system("pause");
      }
  }
  </code></pre>
  
  <p>However, it gets only the foreground window.</p>
  
  <ol>
  <li><p>I need to get all window names </p></li>
  <li><p>Or, actually, I need to get one specific window name which belongs to the "notepad.exe" process.</p></li>
  </ol>
  
  <p>Thanks for your help :)</p>