c# 快捷方式 c# Shortcut中没有shift+方向键,咋样把它加进入啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 [DllImport("user32.dll", SetLastError = true)]public static extern bool RegisterHotKey( IntPtr hWnd, int id, KeyModifiers fsModifiers, Keys vk ); [DllImport("user32.dll", SetLastError = true)]public static extern bool UnregisterHotKey( IntPtr hWnd, int id );自己定义然后protected override void WndProc(ref Message m){ const int WM_HOTKEY = 0x0312; switch (m.Msg) { case WM_HOTKEY: switch (m.WParam.ToInt32()) { case ***//这里填需要处理的值,如果有其他的还可以继续添加 break; } } break; } base.WndProc(ref m);} 那我咋知道m.Msg值是多少啊?比如shift+Left public MainForm(){...RegisterHotKey(Handle, 100, 4, Keys.Left); // Shift +光标左箭头RegisterHotKey(Handle, 200, 4, Keys.Right); / /Shift +光标右箭头RegisterHotKey(Handle, 300, 4, Keys.Up); // Shift +光标上箭头RegisterHotKey(Handle, 400, 4, Keys.Down); // Shift +光标下箭头}public enum KeyModifiers{None = 0,Alt = 1,Control = 2,Shift = 4,Windows = 8} RegisterHotKey这个就是让你自己定义的 论坛里用C# + AE开发的人多吗? Castle ActiveRecord小问题 C#关于时间比较的问题!!在线等待!!!!!!!!!!!!!!!!!!!!!!!!!! 新手求助:如何正确调用方法 从数据库获取一个字段的统计值之后怎样赋给变量? 有谁做过网上购物网站? 无法删除图片文件?求解 在dataAdapter.update执行时,如何终止update操作? CMIC(大象)请进来,一个问题还没有讨论明白,欢迎大家都来抢分!! 告訴大家一個秘密(高手可以不進了) 字段、属性、接口、事件、方法、类等的默认访问修饰符是什么? listview 选中行
public static extern bool RegisterHotKey(
IntPtr hWnd,
int id,
KeyModifiers fsModifiers,
Keys vk
);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool UnregisterHotKey(
IntPtr hWnd,
int id
);
自己定义
然后protected override void WndProc(ref Message m)
{
const int WM_HOTKEY = 0x0312;
switch (m.Msg)
{
case WM_HOTKEY:
switch (m.WParam.ToInt32())
{
case ***//这里填需要处理的值,如果有其他的还可以继续添加
break;
}
}
break;
}
base.WndProc(ref m);
}
public MainForm()
{
...
RegisterHotKey(Handle, 100, 4, Keys.Left); // Shift +光标左箭头
RegisterHotKey(Handle, 200, 4, Keys.Right); / /Shift +光标右箭头
RegisterHotKey(Handle, 300, 4, Keys.Up); // Shift +光标上箭头
RegisterHotKey(Handle, 400, 4, Keys.Down); // Shift +光标下箭头
}public enum KeyModifiers
{
None = 0,
Alt = 1,
Control = 2,
Shift = 4,
Windows = 8
}