In Depth Banner
Skip Navigation Links

Select your preferred language

The interop prototypes and structures.

    [DllImport("User32.dll")]

    protected static extern int ReleaseDC(IntPtr hWnd, IntPtr dc);

 

    [DllImport("User32.dll")]

    protected static extern IntPtr GetWindowDC(IntPtr hWnd);

 

    [DllImport("user32.dll")]

    protected static extern int GetWindowRect(IntPtr hWnd, ref RECT rect);

 

 

    //The Win32 RECT structure rebuilt for interop

    [StructLayout(LayoutKind.Sequential)]

      public struct RECT

    {

      public Int32 left;

      public Int32 top;

      public Int32 right;

      public Int32 bottom;

 

      public override string ToString()

      {

        return string.Format("({0},{1},{2},{3})  ",left,top,right,bottom);

      }

 

    }

 

Return to the article.

Copyright © Bob Powell 2003-2009. All rights reserved