nativemethods.cs

来自「基于ehotgis嵌入式gis平台的图层控制源码」· CS 代码 · 共 42 行

CS
42
字号
using System;
using System.Runtime.InteropServices;

namespace OpenNETCF.Windows.Forms
{
	internal delegate IntPtr WndProcDelegate(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
	/// <summary>
	/// Summary description for NativeMethods.
	/// </summary>
	internal class NativeMethods
	{
		[DllImport("coredll.dll", SetLastError=true)]
		public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

		[DllImport("coredll.dll", SetLastError = true)]
		public static extern int SetWindowLong(IntPtr hWnd, int nIndex, WndProcDelegate newProc);

		[DllImport("coredll.dll", SetLastError = true)]
		public static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex);

		[DllImport("coredll.dll")]
		public static extern IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

		[DllImport("coredll.dll")]
		public static extern IntPtr CreateWindowEx(uint dwExStyle, string lpClassName,
			string lpWindowName, uint dwStyle, int x, int y, int nWidth, int nHeight,
			IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lpParam);

		[DllImport("coredll.dll", CharSet = CharSet.Auto)]
		public static extern IntPtr DefWindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);

		[DllImport("coredll.dll", CharSet = CharSet.Auto)]
		public static extern IntPtr GetModuleHandle(string modName);

		[DllImport("coredll.dll", CharSet = CharSet.Auto)]
		public static extern bool DestroyWindow(IntPtr hWnd);

		

	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?