diff options
| author | jpbruyere <jp_bruyere@hotmail.com> | 2013-11-16 09:16:43 +0100 |
|---|---|---|
| committer | jpbruyere <jp_bruyere@hotmail.com> | 2013-11-16 09:16:43 +0100 |
| commit | dab0f2befeda33bd1c8e59ec41a2e1768712086b (patch) | |
| tree | e1dc606a3d8eeccd221e8adc03edc8639c3daa17 /src/Win32.cs | |
first commit
Diffstat (limited to 'src/Win32.cs')
| -rw-r--r-- | src/Win32.cs | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/Win32.cs b/src/Win32.cs new file mode 100644 index 00000000..292ea778 --- /dev/null +++ b/src/Win32.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Runtime.InteropServices; + +namespace go +{ + public static class Win32 + { + [DllImport("user32.dll")] + public static extern IntPtr GetDC(IntPtr hWnd); + #region mouse winApi + + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public struct Point + { + + /// LONG->int + public int x; + + /// LONG->int + public int y; + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public struct HICON__ + { + + /// int + public int unused; + } + +#if _WIN32 || _WIN64 + /// Return Type: HCURSOR->HICON->HICON__* + ///hCursor: HCURSOR->HICON->HICON__* + [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursor")] + public static extern System.IntPtr SetCursor([System.Runtime.InteropServices.InAttribute()] System.IntPtr hCursor); +#elif __linux__ + public static System.IntPtr SetCursor(System.IntPtr hCursor) + { + return (IntPtr)0; + } +#endif + + /// Return Type: BOOL->int + ///lpPoint: LPPOINT->tagPOINT* + [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetCursorPos")] + [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] + public static extern bool GetCursorPos([System.Runtime.InteropServices.OutAttribute()] out Point lpPoint); + + /// Return Type: BOOL->int + ///X: int + ///Y: int + [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursorPos")] + [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] + public static extern bool SetCursorPos(int X, int Y); + + #endregion + } +} |