/trunk/Widow/Natives.cs |
@@ -1,4 +1,5 @@ |
using System; |
using System.Drawing; |
using System.Runtime.InteropServices; |
using System.Text; |
|
@@ -6,9 +7,6 @@ |
{ |
public static class Natives |
{ |
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] |
public static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount); |
|
#region Public Events & Delegates |
|
public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam); |
@@ -17,7 +15,80 @@ |
|
#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 |
/// Documentation pulled from MSDN. |
@@ -1519,6 +1590,29 @@ |
#region Public Methods |
|
[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")] |