/******************************************************************************
 * User32.cs 
 * 
 * <Copyright and License> 
 * 
 * This file is part of GODS, a package for annotating medical images. 
 * 
 * Copyright (C) 2004 
 * Xuedong Chen 
 * Heri Mariwa 
 * Kimmy (Hsiang-ling) Lin 
 * Rui Yu 
 * 
 * This program is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License 
 * as published by the Free Software Foundation; either version 2 
 * of the License, or (at your option) any later version. 
 * 
 * This program is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 * GNU General Public License for more details. 
 * 
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 *  
 * For further questions about this file, please send email to 
 * gods@cs.umb.edu or visit us at http://gods.sourceforge.net.  
 ******************************************************************************/

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace GODS
{
	namespace ScreenCapture
	{
		/// <summary>
		/// User32 wrape up Win32 API with some struct that used by those API
		/// These APIs are related to windows manipulation.
		/// </summary>
		public class User32
		{
			[StructLayout(LayoutKind.Sequential)]
				public struct RECT
			{
				public int left;
				public int top;
				public int right;
				public int bottom;
			}

			[StructLayout(LayoutKind.Sequential)]
				public struct POINT
			{
				public int X;
				public int Y;
			}
			[DllImport("user32.dll")]
			public static extern IntPtr GetDesktopWindow();
			[DllImport("user32.dll")]
			public static extern IntPtr GetWindowDC(IntPtr hWnd);
			[DllImport("user32.dll")]
			public static extern IntPtr ReleaseDC(IntPtr hWnd,IntPtr hDC);
			[DllImport("user32.dll")]
			public static extern IntPtr GetWindowRect(IntPtr hWnd,ref RECT rect);

			[DllImport("user32.dll")] 
			public static extern IntPtr GetActiveWindow();
			#region using user32.dll to transfer cursors position to screen to client

			[DllImport("user32.dll", EntryPoint = "ScreenToClient")] 

			static public extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint);



			[DllImport("user32.dll", EntryPoint = "ClientToScreen")] 

			static public extern bool ClientToScreen(IntPtr hWnd, ref POINT lpPoint);



			[DllImport("user32.dll", EntryPoint = "GetCursorPos")] 

			static public extern bool GetCursorPos(ref POINT lpPoint);



			[DllImport("user32.dll", EntryPoint = "SetCursorPos")] 

			static public extern bool SetCursorPos(int X, int Y);



			[DllImport("user32.dll", EntryPoint = "WindowFromPoint")]

			static public extern IntPtr WindowFromPoint(POINT Point);



			/// <summary>

			/// POINT struct

			/// </summary>

		

			#endregion
		
			public User32()
			{
				//
				// TODO: Add constructor logic here
				//
			}

		}
	}
}

