|
楼主 |
发表于 2010-6-18 21:28
|
显示全部楼层
- #region DLL导出
- [DllImport("User32")]
- public extern static void mouse_event(int dwFlags, int dx, int dy, int dwData, IntPtr dwExtraInfo);
- [DllImport("User32")]
- public extern static void SetCursorPos(int x, int y);
- [DllImport("User32")]
- public extern static bool GetCursorPos(out POINT p);
- [DllImport("User32")]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool GetWindowRect(IntPtr hwnd, ref RECT lpRect);
- [DllImport("User32")]
- public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
- [DllImport("User32")]
- public static extern IntPtr SetActiveWindow(IntPtr hWnd);
- [DllImport("User32")]
- public static extern IntPtr BringWindowToTop(IntPtr hWnd);
- [DllImport("User32")]
- public static extern bool SetWindowPos(
- IntPtr hWnd,
- int hWndInsertAfter,
- int x,
- int y,
- int cx,
- int cy,
- uint uFlags);
- public const int HWND_BOTTOM = 1;
- public const int HWND_TOPMOST = -1;
- public const uint SWP_NOSIZE = 1;
- [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;
- }
复制代码 |
|