title: GetCursorInfo WinForms vs WPF C#
body: <p>I am having trouble of transferring pieces of my code from WinForms to WPF to have better control over the UI.</p>
  
  <p>The following piece of code return True in WinForms but False in WPF. I suspect WPF panels have effects on the cursor so I tried start the app minimized but it still failed. Since the GetCursorInfo is PInvoke I think it should work the same within a programming language. Any advices on this?</p>
  
  <pre><code>    private CURSORINFO ci;
  
      [StructLayout(LayoutKind.Sequential)]
      public struct CURSORINFO
      {
          public Int32 cbSize;        // Specifies the size, in bytes, of the structure. 
          public Int32 flags;         // Specifies the cursor state.
          public IntPtr hCursor;      // Handle to the cursor. 
          Point point; // Should already marshal correctly.
      }
  
      [DllImport("user32.dll")]
      [return: MarshalAs(UnmanagedType.Bool)]
      public static extern bool GetCursorInfo(ref CURSORINFO pci);
  
      public MainWindow()
      {
          InitializeComponent();
  
          ci = new CURSORINFO();
  
          ci.cbSize = Marshal.SizeOf(ci);
  
          MessageBox.Show(GetCursorInfo(ref ci).ToString());
      }    
  </code></pre>