title: Need help with getting the current memory on a program
body: <p>I need to get the up to date memory useage of a program that is running. i googled it and found <a href="http://msdn.microsoft.com/en-us/library/ms683219.aspx" rel="nofollow">GetProcessMemoryInfo</a> this looks like what i needed but i can't get it to work.
  It wont take the handle i find for the window and i am not really sure what they want.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;Windows.h&gt;
  #include &lt;tchar.h&gt; 
  #include &lt;Psapi.h&gt;
  
  using namespace std;
  
  
  int main()
  {
  
  HANDLE hwnd = FindWindow(NULL,TEXT("Calculator"));
  
  
  PPROCESS_MEMORY_COUNTERS ppsmemCounters;
  
  DWORD cb;
  
  BOOL WINAPI GetProcessMemoryInfo(hwnd, ppsmemCounters, cb);
  
  return 0;
  }
  </code></pre>
  
  <p>I am just trying to find the window's calculator for now.
  One of the errors i get is Error:a value of type "HANDLE" cannot be used to initialize an entity type "BOOL".
  Another is "error C2078: too many initializers".
  I am using VC++ 2010, and my os is Windows 7.</p>