title: Determine number of GDI handles and USER objects
body: <p>We developed a small test suite for our Windows Forms UI rendering engine which allows to measure performance and detect memory leaks while running test cases in an automated manner. Now we would like to check for handle leaks as well. On the desktop platform we can use this code:</p>
  
  <pre><code>[DllImport("User32")]
  private extern static int GetGuiResources(IntPtr hProcess, int uiFlags);
  
  using (var process = Process.GetCurrentProcess())
  {
    var gdiHandles = GetGuiResources(process.Handle, 0);
    var userHandles = GetGuiResources(process.Handle, 1);
  }
  </code></pre>
  
  <p>This method doesn't seem to be available in Windows Mobile. Is there another way to determine these values programmatically on Windows Mobile/CE?</p>