0

I am having an issues trying to call the GetClientRect and passing in a Stuct to get populated with the values that are returned. Here is the code I have.

[return: MarshalAs(UnmanagedType.Bool)]
        [DllImport("user32.dll")]
        internal static extern bool GetClientRect(IntPtr hwnd, ref RECT lpRect);

        [StructLayout(LayoutKind.Sequential)]
        internal struct RECT
        {
            internal int left;
            internal int top;
            internal int right;
            internal int bottom;
        }
     RECT rect = new RECT();

     GetClientRect(PApplication.Instance.MdiMain.Handle, ref rect);

I keep getting the error on the RECT saysing Error 1 Embedded statement cannot be a declaration or labeled statement.

I just need help getting back the left top right bottome values from the GetClientRect

Marc
  • 16,170
  • 20
  • 76
  • 119
Spafa9
  • 742
  • 3
  • 14
  • 30

1 Answers1

0

I found it I put the code after an if and forgot to add { } so I am good now.

Spafa9
  • 742
  • 3
  • 14
  • 30