Widow

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ HEAD  →  ?path2? @ 1
/trunk/Widow/Natives.cs
@@ -1,5 +1,4 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
 
@@ -7,95 +6,8 @@
{
public static class Natives
{
#region Static Fields and Constants
 
public const int HWND_BROADCAST = 0xffff;
 
public static readonly int WM_SHOWME = RegisterWindowMessage("WM_SHOWME");
 
#endregion
 
#region Public Events & Delegates
 
public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
 
#endregion
 
#region Public Enums, Properties and Fields
 
public enum OCR_SYSTEM_CURSORS : uint
{
/// <summary>
/// Standard arrow and small hourglass
/// </summary>
OCR_APPSTARTING = 32650,
 
/// <summary>
/// Standard arrow
/// </summary>
OCR_NORMAL = 32512,
 
/// <summary>
/// Crosshair
/// </summary>
OCR_CROSS = 32515,
 
/// <summary>
/// Windows 2000/XP: Hand
/// </summary>
OCR_HAND = 32649,
 
/// <summary>
/// Arrow and question mark
/// </summary>
OCR_HELP = 32651,
 
/// <summary>
/// I-beam
/// </summary>
OCR_IBEAM = 32513,
 
/// <summary>
/// Slashed circle
/// </summary>
OCR_NO = 32648,
 
/// <summary>
/// Four-pointed arrow pointing north, south, east, and west
/// </summary>
OCR_SIZEALL = 32646,
 
/// <summary>
/// Double-pointed arrow pointing northeast and southwest
/// </summary>
OCR_SIZENESW = 32643,
 
/// <summary>
/// Double-pointed arrow pointing north and south
/// </summary>
OCR_SIZENS = 32645,
 
/// <summary>
/// Double-pointed arrow pointing northwest and southeast
/// </summary>
OCR_SIZENWSE = 32642,
 
/// <summary>
/// Double-pointed arrow pointing west and east
/// </summary>
OCR_SIZEWE = 32644,
 
/// <summary>
/// Vertical arrow
/// </summary>
OCR_UP = 32516,
 
/// <summary>
/// Hourglass
/// </summary>
OCR_WAIT = 32514
}
 
/// <summary>
/// Windows Messages
/// Defined in winuser.h from Windows SDK v6.1
@@ -1597,36 +1509,7 @@
 
#region Public Methods
 
[DllImport("user32")]
public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
 
[DllImport("user32.dll")]
public static extern IntPtr WindowFromPoint(Point p);
 
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
 
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SystemParametersInfo(uint uiAction,
uint uiParam, string pvParam, uint fWinIni);
 
 
[DllImport("user32.dll")]
public static extern bool SetSystemCursor(IntPtr hcur, uint id);
 
[DllImport("user32.dll")]
public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
 
[DllImport("user32.dll")]
public static extern IntPtr CopyIcon(IntPtr pcur);
 
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
 
[DllImport("user32.dll")]
public static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam);
 
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
 
@@ -1642,14 +1525,15 @@
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int GetWindowTextLength(IntPtr hWnd);
 
[DllImport("user32.dll", SetLastError = true)]
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId);
#endregion
 
#region Private Methods
 
[DllImport("user32.dll", SetLastError = true)]
public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
 
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
 
#endregion