title: Get ID from MIDI devices in C++
body: <p>I'm a musician and a programmer and would like to create my own program to make music.
  I'll start with a console application in C++ before I make a GUI.</p>
  
  <p>I'm quiet new to C/C++ and know how to make a basic console application and have read about the Win32 API.</p>
  
  <p>I was looking into MSDN for multimedia in Win32 applications and I found a lot of functions for MIDI: <a href="http://msdn.microsoft.com/en-us/library/dd798495(VS.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/dd798495(VS.85).aspx</a></p>
  
  <p>I can receive how many MIDI devices are plugged in this way:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;iostream&gt;
  using namespace std;
  int main() {
      cout &lt;&lt; midiInGetNumDevs();
      cout &lt;&lt; " MIDI devices connected" &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>But now i want to find out how these devices are called, with the <code>midiInGetID</code> function I think and a <code>while</code> loop. Can somebody help me with this? The function requires a <code>HMIDIIN</code> parameter and I don't know how I can get one since almost all the MIDI functions use this parameter.</p>
  
  <p>I know this is not the most obvious topic but it would be great if someone could help me.</p>
  
  <p>Thanks :)</p>