Hooks.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Text;
  4. namespace Interop
  5. {
  6. internal enum HookType //枚举,钩子的类型
  7. {
  8. // MSGFILTER = -1,
  9. // JOURNALRECORD = 0,
  10. // JOURNALPLAYBACK = 1,
  11. KEYBOARD = 2,
  12. GETMESSAGE = 3,
  13. CALLWNDPROC = 4,
  14. // CBT = 5,
  15. SYSMSGFILTER = 6,
  16. //MOUSE = 7,
  17. HARDWARE = 8,
  18. // DEBUG = 9,
  19. // SHELL = 10,
  20. // FOREGROUNDIDLE = 11,
  21. CALLWNDPROCRET = 12,
  22. KEYBOARDLL = 13,
  23. // MOUSELL = 14,
  24. };
  25. public enum WMsG
  26. {
  27. WM_NULL = 0x0000,
  28. WM_CREATE = 0x0001,
  29. WM_DESTROY = 0x0002,
  30. WM_MOVE = 0x0003,
  31. WM_SIZE = 0x0005,
  32. WM_ACTIVATE = 0x0006,
  33. WA_INACTIVE = 0,
  34. WA_ACTIVE = 1,
  35. WA_CLICKACTIVE = 2,
  36. WM_SETFOCUS = 0x0007,
  37. WM_KILLFOCUS = 0x0008,
  38. WM_ENABLE = 0x000A,
  39. WM_SETREDRAW = 0x000B,
  40. WM_SETTEXT = 0x000C,
  41. WM_GETTEXT = 0x000D,
  42. WM_GETTEXTLENGTH = 0x000E,
  43. WM_PAINT = 0x000F,
  44. WM_CLOSE = 0x0010,
  45. WM_QUERYENDSESSION = 0x0011,
  46. WM_QUERYOPEN = 0x0013,
  47. WM_ENDSESSION = 0x0016,
  48. WM_QUIT = 0x0012,
  49. WM_ERASEBKGND = 0x0014,
  50. WM_SYSCOLORCHANGE = 0x0015,
  51. WM_SHOWWINDOW = 0x0018,
  52. WM_WININICHANGE = 0x001A,
  53. WM_DEVMODECHANGE = 0x001B,
  54. WM_ACTIVATEAPP = 0x001C,
  55. WM_FONTCHANGE = 0x001D,
  56. WM_TIMECHANGE = 0x001E,
  57. WM_CANCELMODE = 0x001F,
  58. WM_SETCURSOR = 0x0020,
  59. WM_MOUSEACTIVATE = 0x0021,
  60. WM_CHILDACTIVATE = 0x0022,
  61. WM_QUEUESYNC = 0x0023,
  62. WM_GETMINMAXINFO = 0x0024,
  63. WM_KEYFIRST = 0x0100,
  64. WM_KEYDOWN = 0x0100,
  65. WM_KEYUP = 0x0101,
  66. WM_CHAR = 0x0102,
  67. WM_DEADCHAR = 0x0103,
  68. WM_SYSKEYDOWN = 0x0104,
  69. WM_SYSKEYUP = 0x0105,
  70. WM_SYSCHAR = 0x0106,
  71. WM_SYSDEADCHAR = 0x0107,
  72. WM_MOUSEFIRST = 0x0200,
  73. WM_MOUSEMOVE = 0x0200,
  74. // 移动鼠标
  75. WM_LBUTTONDOWN = 0x0201,
  76. //按下鼠标左键
  77. WM_LBUTTONUP = 0x0202,
  78. //释放鼠标左键
  79. WM_LBUTTONDBLCLK = 0x0203,
  80. //双击鼠标左键
  81. WM_RBUTTONDOWN = 0x0204,
  82. //按下鼠标右键
  83. WM_RBUTTONUP = 0x0205,
  84. //释放鼠标右键
  85. WM_RBUTTONDBLCLK = 0x0206,
  86. //双击鼠标右键
  87. WM_MBUTTONDOWN = 0x0207,
  88. //按下鼠标中键
  89. WM_MBUTTONUP = 0x0208,
  90. //释放鼠标中键
  91. WM_MBUTTONDBLCLK = 0x0209,
  92. //双击鼠标中键
  93. WM_MOUSEWHEEL = 0x020A,
  94. }
  95. /// <summary>
  96. /// 鼠标动作枚举
  97. /// </summary>
  98. public enum MouseEventFlag : uint
  99. {
  100. MOVE = 0X0001,
  101. LEFTDOWN = 0X0002,
  102. LEFTUP = 0X0004,
  103. RIGHTDOWN = 0X0008,
  104. RIGHTUP = 0X0010,
  105. MIDDLEDOWN = 0X0020,
  106. MIDDLEUP = 0X0040,
  107. XDOWN = 0X0080,
  108. XUP = 0X0100,
  109. WHEEL = 0X0800,
  110. VIRTUALDESK = 0X4000,
  111. ABSOLUTE = 0X8000
  112. }
  113. /// <summary>
  114. /// 键盘动作枚举
  115. /// </summary>
  116. public enum VirtualKeys : byte
  117. {
  118. // VK_NUMLOCK = 0x90, // 数字锁定键
  119. // VK_SCROLL = 0x91, // 滚动锁定
  120. // VK_CAPITAL = 0x14, // 大小写锁定
  121. // VK_A = 62, // 键盘A
  122. VK_LBUTTON = 1, // 鼠标左键
  123. VK_RBUTTON = 2, // 鼠标右键
  124. VK_CANCEL = 3, // Ctrl+Break(通常不需要处理)
  125. VK_MBUTTON = 4, // 鼠标中键
  126. VK_BACK = 8, // Backspace
  127. VK_TAB = 9, // Tab
  128. VK_CLEAR = 12, // Num Lock关闭时的数字键盘5
  129. VK_RETURN = 13, // Enter(或者另一个)
  130. VK_SHIFT = 16, // Shift(或者另一个)
  131. VK_CONTROL = 17, // Ctrl(或者另一个)
  132. VK_MENU = 18, // Alt(或者另一个)
  133. VK_PAUSE = 19, // Pause
  134. VK_CAPITAL = 20, // Caps Lock
  135. VK_ESCAPE = 27, // Esc
  136. VK_SPACE = 32, // Spacebar
  137. VK_PRIOR = 33, // Page Up
  138. VK_NEXT = 34, // Page Down
  139. VK_END = 35, // End
  140. VK_HOME = 36, // Home
  141. VK_LEFT = 37, // 左箭头
  142. VK_UP = 38, // 上箭头
  143. VK_RIGHT = 39, // 右箭头
  144. VK_DOWN = 40, // 下箭头
  145. VK_SELECT = 41, // 可选
  146. VK_PRINT = 42, // 可选
  147. VK_EXECUTE = 43, // 可选
  148. VK_SNAPSHOT = 44, // Print Screen
  149. VK_INSERT = 45, // Insert
  150. VK_DELETE = 46, // Delete
  151. VK_HELP = 47, // 可选
  152. VK_NUM0 = 48, // 0
  153. VK_NUM1 = 49, // 1
  154. VK_NUM2 = 50, // 2
  155. VK_NUM3 = 51, // 3
  156. VK_NUM4 = 52, // 4
  157. VK_NUM5 = 53, // 5
  158. VK_NUM6 = 54, // 6
  159. VK_NUM7 = 55, // 7
  160. VK_NUM8 = 56, // 8
  161. VK_NUM9 = 57, // 9
  162. VK_A = 65, // A
  163. VK_B = 66, // B
  164. VK_C = 67, // C
  165. VK_D = 68, // D
  166. VK_E = 69, // E
  167. VK_F = 70, // F
  168. VK_G = 71, // G
  169. VK_H = 72, // H
  170. VK_I = 73, // I
  171. VK_J = 74, // J
  172. VK_K = 75, // K
  173. VK_L = 76, // L
  174. VK_M = 77, // M
  175. VK_N = 78, // N
  176. VK_O = 79, // O
  177. VK_P = 80, // P
  178. VK_Q = 81, // Q
  179. VK_R = 82, // R
  180. VK_S = 83, // S
  181. VK_T = 84, // T
  182. VK_U = 85, // U
  183. VK_V = 86, // V
  184. VK_W = 87, // W
  185. VK_X = 88, // X
  186. VK_Y = 89, // Y
  187. VK_Z = 90, // Z
  188. VK_NUMPAD0 = 96, // 0
  189. VK_NUMPAD1 = 97, // 1
  190. VK_NUMPAD2 = 98, // 2
  191. VK_NUMPAD3 = 99, // 3
  192. VK_NUMPAD4 = 100, // 4
  193. VK_NUMPAD5 = 101, // 5
  194. VK_NUMPAD6 = 102, // 6
  195. VK_NUMPAD7 = 103, // 7
  196. VK_NUMPAD8 = 104, // 8
  197. VK_NUMPAD9 = 105, // 9
  198. VK_NULTIPLY = 106, // 数字键盘上的*
  199. VK_ADD = 107, // 数字键盘上的+
  200. VK_SEPARATOR = 108, // 可选
  201. VK_SUBTRACT = 109, // 数字键盘上的-
  202. VK_DECIMAL = 110, // 数字键盘上的.
  203. VK_DIVIDE = 111, // 数字键盘上的/
  204. VK_F1 = 112,
  205. VK_F2 = 113,
  206. VK_F3 = 114,
  207. VK_F4 = 115,
  208. VK_F5 = 116,
  209. VK_F6 = 117,
  210. VK_F7 = 118,
  211. VK_F8 = 119,
  212. VK_F9 = 120,
  213. VK_F10 = 121,
  214. VK_F11 = 122,
  215. VK_F12 = 123,
  216. VK_NUMLOCK = 144, // Num Lock
  217. VK_SCROLL = 145 // Scroll Lock
  218. }
  219. public enum NCmdShow : uint
  220. {
  221. SW_FORCEMINIMIZE = 0x0,
  222. SW_HIDE = 0x1,
  223. SW_MAXIMIZE = 0x2,
  224. SW_MINIMIZE = 0x3,
  225. SW_RESTORE = 0x4,
  226. SW_SHOW = 0x5,
  227. SW_SHOWDEFAULT = 0x6,
  228. SW_SHOWMAXIMIZED = 0x7,
  229. SW_SHOWMINIMIZED = 0x8,
  230. SW_SHOWMINNOACTIVE = 0x9,
  231. SW_SHOWNA = 0xA,
  232. SW_SHOWNOACTIVATE = 0xB,
  233. SW_SHOWNORMAL = 0xC,
  234. WM_CLOSE = 0x10,
  235. }
  236. [StructLayout(LayoutKind.Sequential)]
  237. public struct KbDllHook
  238. {
  239. public int vkCode;
  240. public int scanCode;
  241. public int flags;
  242. public int time;
  243. public int dwExtraInfo;
  244. }
  245. [StructLayout(LayoutKind.Sequential)]
  246. public struct Rect
  247. {
  248. public int left;
  249. public int right;
  250. public int top;
  251. public int button;
  252. }
  253. [StructLayout(LayoutKind.Sequential)]
  254. public struct Point
  255. {
  256. public int x;
  257. public int y;
  258. }
  259. [StructLayout(LayoutKind.Sequential)]
  260. public struct WindowPlacement
  261. {
  262. public int length;
  263. public int flags;
  264. public int showCmd;
  265. public Point ptMinPosition;
  266. public Point ptMaxPosition;
  267. public Rect rcNormalPosition;
  268. }
  269. [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
  270. public struct Luid
  271. {
  272. public uint lowPart;
  273. public uint highPart;
  274. };
  275. [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
  276. public struct TokenPrivileges
  277. {
  278. public uint privilegeCount;
  279. public Luid luid;
  280. public uint attributes;
  281. };
  282. public delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam);
  283. public delegate int EnumWindowProc(IntPtr hWnd, IntPtr parameter, string className);
  284. public class Hooks
  285. {
  286. [DllImport("user32.dll", EntryPoint = "GetClassName")]
  287. public static extern int GetClassName(IntPtr hwnd, StringBuilder lpClassName, int nMaxCount);
  288. [DllImport("user32.dll")]
  289. public static extern int GetWindowText(int hWnd, StringBuilder lpString, int nMaxCount);
  290. [DllImport("user32")]
  291. [return: MarshalAs(UnmanagedType.Bool)]
  292. //IMPORTANT : LPARAM must be a pointer (InterPtr) in VS2005, otherwise an exception will be thrown
  293. private static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i);
  294. //the callback function for the EnumChildWindows
  295. //用于系统关机等权限操作
  296. [DllImport("user32.dll", EntryPoint = "ExitWindowsEx", CharSet = CharSet.Auto)]
  297. private static extern int ExitWindowsEx(int uFlags, int dwReserved);
  298. [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
  299. private static extern int GetCurrentProcess();
  300. [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
  301. private static extern int GetLastError();
  302. [DllImport("advapi32", CharSet = CharSet.Auto)]
  303. private static extern int OpenProcessToken(int ProcessHandle, uint DesiredAccess, ref int TokenHandle);
  304. [DllImport("advapi32", CharSet = CharSet.Auto)]
  305. private static extern int LookupPrivilegeValue(String lpSystemName, String lpName, ref Luid lpLuid);
  306. [DllImport("advapi32", CharSet = CharSet.Auto)]
  307. private static extern int AdjustTokenPrivileges(int TokenHandle, bool DisableAllPrivileges, ref TokenPrivileges NewState, int BufferLength, int PreviousState, int ReturnLength);
  308. [DllImport("activ.dll", CharSet = CharSet.Auto)]
  309. public static extern bool ForceForegroundWindow(int hwnd);
  310. //主要用于更改程序标题
  311. //这个函数用来置顶显示,参数hwnd为窗口句柄
  312. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  313. public static extern bool SetWindowTextA(IntPtr hwn, IntPtr lpString);
  314. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  315. public static extern void SetForegroundWindow(int hwnd);
  316. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  317. public static extern bool BringWindowToTop(IntPtr hwnd);
  318. //这个函数用来显示窗口,参数hwnd为窗口句柄,nCmdShow是显示类型的枚举
  319. [DllImport("user32.dll")]
  320. public static extern bool ShowWindow(int hWnd, NCmdShow nCmdShow);
  321. [DllImport("user32.dll")]
  322. public static extern bool SetWindowPos(int hwnd, int hWndInsertAfter, int x, int y, int cx, int cy, uint wFlags);
  323. //得到窗体句柄的函数,FindWindow函数用来返回符合指定的类名( ClassName )和窗口名( WindowTitle )的窗口句柄
  324. [DllImport("user32.dll")]
  325. public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
  326. // 查找窗口
  327. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  328. public static extern IntPtr FindWindowEx(IntPtr hWndFather, IntPtr hWndPreChild, string lpszClass, string lpszWindows);
  329. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  330. private static extern bool GetWindowPlacement(int hwnd, ref WindowPlacement lpwndpl);
  331. [DllImport("user32.dll")]
  332. private static extern int GetWindowThreadProcessId(int id, int pid);
  333. [DllImport("user32.dll")]
  334. private static extern bool GetWindowRect(int hwnd, ref Rect lpwndpl);
  335. [DllImport("kernel32.dll")]
  336. private static extern void CloseHandle(uint hObject); //Handle to object
  337. // 读取进程内存的函数
  338. [DllImport("kernel32.dll")]
  339. static extern bool ReadProcessMemory(
  340. uint hProcess,
  341. int lpBaseAddress,
  342. out int lpBuffer,
  343. uint nSize,
  344. int lpNumberOfBytesRead
  345. );
  346. [DllImport("kernel32.dll")]
  347. static extern bool ReadProcessMemory(
  348. uint hProcess,
  349. int lpBaseAddress,
  350. char[] lpBuffer,
  351. uint nSize,
  352. uint lpNumberOfBytesRead
  353. );
  354. [DllImport("kernel32.dll")]
  355. static extern bool ReadProcessMemory(
  356. uint hProcess,
  357. int lpBaseAddress,
  358. string lpBuffer,
  359. uint nSize,
  360. uint lpNumberOfBytesRead
  361. );
  362. [DllImport("kernel32.dll")]
  363. public static extern bool ReadProcessMemory(
  364. uint hProcess,
  365. int lpBaseAddress,
  366. byte[] lpBuffer,
  367. int nSize,
  368. uint lpNumberOfBytesRead
  369. );
  370. // 得到目标进程句柄的函数
  371. [DllImport("kernel32.dll")]
  372. public static extern uint OpenProcess(uint dwDesiredAccess, bool bInheritHandle, int dwProcessId);
  373. // 鼠标事件声明
  374. [DllImport("user32.dll")]
  375. static extern bool setcursorpos(int x, int y);
  376. [DllImport("user32.dll")]
  377. static extern void mouse_event(MouseEventFlag flags, int dx, int dy, uint data, UIntPtr extrainfo);
  378. // 键盘事件声明
  379. [DllImport("user32.dll")]
  380. static extern byte MapVirtualKey(byte wCode, int wMap);
  381. [DllImport("user32.dll")]
  382. static extern short GetKeyState(int nVirtKey);
  383. [DllImport("user32.dll")]
  384. static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo);
  385. // 键盘事件声明winio
  386. [DllImport("winio.dll")]
  387. public static extern bool InitializeWinIo();
  388. [DllImport("winio.dll")]
  389. public static extern bool GetPortVal(IntPtr wPortAddr, out int pdwPortVal, byte bSize);
  390. [DllImport("winio.dll")]
  391. public static extern bool SetPortVal(uint wPortAddr, IntPtr dwPortVal, byte bSize);
  392. [DllImport("winio.dll")]
  393. public static extern byte MapPhysToLin(byte pbPhysAddr, uint dwPhysSize, IntPtr PhysicalMemoryHandle);
  394. [DllImport("winio.dll")]
  395. public static extern bool UnmapPhysicalMemory(IntPtr PhysicalMemoryHandle, byte pbLinAddr);
  396. [DllImport("winio.dll")]
  397. public static extern bool GetPhysLong(IntPtr pbPhysAddr, byte pdwPhysVal);
  398. [DllImport("winio.dll")]
  399. public static extern bool SetPhysLong(IntPtr pbPhysAddr, byte dwPhysVal);
  400. [DllImport("winio.dll")]
  401. public static extern void ShutdownWinIo();
  402. // 全局键盘钩子
  403. // 第一个参数:指定钩子的类型,有WH_MOUSE、WH_KEYBOARD等十多种(具体参见MSDN)
  404. // 第二个参数:标识钩子函数的入口地址
  405. // 第三个参数:钩子函数所在模块的句柄;
  406. // 第四个参数:钩子相关函数的ID用以指定想让钩子去钩哪个线程,为0时则拦截整个系统的消息。
  407. // 安装在钩子链表中的钩子子程
  408. [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  409. public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);
  410. [DllImport("user32")]
  411. private static extern int GetKeyboardState(byte[] pbKeyState);
  412. // 取得模块句柄
  413. [DllImport("kernel32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
  414. private static extern IntPtr GetModuleHandle(string lpModuleName);
  415. // 移除由SetWindowsHookEx方法安装在钩子链表中的钩子子程
  416. [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
  417. public static extern bool UnhookWindowsHookEx(IntPtr hhook);
  418. // 对一个事件处理的hook可能有多个,它们成链状,使用CallNextHookEx一级一级地调用。简单解释过来就是“调用下一个HOOK”
  419. [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
  420. public static extern IntPtr CallNextHookEx(IntPtr hhook, int code, IntPtr wparam, IntPtr lparam);
  421. // 发送系统消息
  422. [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
  423. public static extern bool PostMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
  424. // 发送系统消息
  425. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  426. public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
  427. [DllImport("user32.dll", CharSet = CharSet.Auto)]
  428. public static extern int SendMessage(IntPtr hWnd, int msg, byte[] wParam, int lParam);
  429. // 函数功能描述:将一块内存的数据从一个位置复制到另一个位置
  430. [DllImport("Kernel32.dll", EntryPoint = "RtlMoveMemory")]
  431. public static extern void CopyMemory(ref KbDllHook Source, IntPtr Destination, int Length);
  432. // 函数功能描述:将一块内存的数据从一个位置复制到另一个位置
  433. [DllImport("Kernel32.dll", EntryPoint = "RtlMoveMemory")]
  434. public static extern void CopyMemory(KbDllHook Source, IntPtr Destination, int Length);
  435. // 取得当前线程编号的API
  436. [DllImport("kernel32.dll")]
  437. static extern int GetCurrentThreadId();
  438. //********************************************************************************************
  439. // 获取屏幕1024*768图像
  440. [DllImport("gdi32.dll")]
  441. public static extern int BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, UInt32 dwRop);
  442. // 创建桌面句柄
  443. [DllImportAttribute("gdi32.dll")]
  444. public static extern IntPtr CreateDC(string lpszDriver, string lpszDevice, string lpszOutput, int lpInitData);
  445. [DllImport("gdi32.dll")]
  446. public static extern IntPtr CreateCompatibleDC(IntPtr hdc);
  447. // 创建与系统匹配的图像资源
  448. [DllImport("gdi32.dll")]
  449. public static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight);
  450. [DllImport("gdi32.dll")]
  451. public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj);
  452. // 删除用过的资源
  453. [DllImport("gdi32.dll")]
  454. public static extern int DeleteDC(IntPtr hdc);
  455. // 释放用过的句柄等资源
  456. [DllImport("user32.dll")]
  457. public static extern bool ReleaseDC(IntPtr hwnd, IntPtr hdc);
  458. // 释放用过的画笔,等图像资源
  459. [DllImport("gdi32.dll")]
  460. public static extern bool DeleteObject(IntPtr hdc);
  461. // 用于像素放大,最后一参数cc0020
  462. [DllImport("gdi32.dll")]
  463. public static extern bool StretchBlt(IntPtr hdcDest, int xDest, int yDest, int wDest, int hDest, IntPtr hdcSrc, int xSrc, int ySrc, int wSrc, int hSrc, IntPtr rop);
  464. }
  465. }