⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nativewin32.cs

📁 C#自定义查询控件
💻 CS
字号:
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace CommonComponent.CommonQuery
{
	/// <summary>
	/// Register Hot Key
	/// </summary>
	public sealed class NativeWin32
	{
		[DllImport("user32.dll", SetLastError=true)] 
		public static extern bool RegisterHotKey( IntPtr hWnd, // handle to window 
			int id, // hot key identifier 
			KeyModifiers fsModifiers, // key-modifier options 
			Keys vk // virtual-key code 
			);

		[DllImport("user32.dll", SetLastError=true)] 
		public static extern bool UnregisterHotKey( IntPtr hWnd, // handle to window 
			int id // hot key identifier 
			); 

		[Flags()]
		public enum KeyModifiers
		{
			None = 0, 
			Alt = 1, 
			Control = 2, 
			Shift = 4
		}
	}
}

⌨️ 快捷键说明

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