| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:NativeMethods.cs
- * 2.功能描述:类文件
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2014/09/01 1.00 新建
- *******************************************************************************/
- using System;
- using System.Diagnostics.CodeAnalysis;
- using System.Drawing;
- using System.Runtime.InteropServices;
- using Dongke.IBOSS.PRD.Basics.DockPanel.Win32;
- namespace Dongke.IBOSS.PRD.Basics.DockPanel
- {
- internal static class NativeMethods
- {
- [DllImport("User32.dll", CharSet = CharSet.Auto)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool DragDetect(IntPtr hWnd, Point pt);
- [DllImport("User32.dll", CharSet = CharSet.Auto)]
- public static extern IntPtr GetFocus();
- [DllImport("User32.dll", CharSet = CharSet.Auto)]
- public static extern IntPtr SetFocus(IntPtr hWnd);
- [DllImport("User32.dll", CharSet = CharSet.Auto)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool PostMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);
- [DllImport("User32.dll", CharSet = CharSet.Auto)]
- public static extern uint SendMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam);
- [DllImport("User32.dll", CharSet = CharSet.Auto)]
- public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndAfter, int X, int Y, int Width, int Height, FlagsSetWindowPos flags);
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- public static extern int GetWindowLong(IntPtr hWnd, int Index);
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- public static extern int SetWindowLong(IntPtr hWnd, int Index, int Value);
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- public static extern int ShowScrollBar(IntPtr hWnd, int wBar, int bShow);
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- //*********************************
- // FxCop bug, suppress the message
- //*********************************
- [SuppressMessage("Microsoft.Portability", "CA1901:PInvokeDeclarationsShouldBePortable", MessageId = "0")]
- public static extern IntPtr WindowFromPoint(Point point);
- [DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
- public static extern int GetCurrentThreadId();
- public delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam);
- [DllImport("user32.dll")]
- public static extern IntPtr SetWindowsHookEx(Win32.HookType code, HookProc func, IntPtr hInstance, int threadID);
- [DllImport("user32.dll")]
- public static extern int UnhookWindowsHookEx(IntPtr hhook);
- [DllImport("user32.dll")]
- public static extern IntPtr CallNextHookEx(IntPtr hhook, int code, IntPtr wParam, IntPtr lParam);
- }
- }
|