我目前正在实施一个方案,从例让中宣布放弃和倒计为5分钟,因此,当你发布<>Start,按规定,它将从5分钟减少到0分钟。
The thing that I would like to have is this:
如果我参加了一场全方位的游戏,例如:战争手工艺世界、图象联盟,或带有全方位插图的游戏和我的新闻Numpad 8 <,我希望节目在Button 1上点首。
这是可能的,因为我以前曾看到过这一点,但我不知道如何这样做。
我目前正在实施一个方案,从例让中宣布放弃和倒计为5分钟,因此,当你发布<>Start,按规定,它将从5分钟减少到0分钟。
The thing that I would like to have is this:
如果我参加了一场全方位的游戏,例如:战争手工艺世界、图象联盟,或带有全方位插图的游戏和我的新闻Numpad 8 <,我希望节目在Button 1上点首。
这是可能的,因为我以前曾看到过这一点,但我不知道如何这样做。
我在图象和Terraria进行了测试。 以下著作:
public static class WindowsAPI
{
public enum HookType : int
{
WH_JOURNALRECORD = 0,
WH_JOURNALPLAYBACK = 1,
WH_KEYBOARD = 2,
WH_GETMESSAGE = 3,
WH_CALLWNDPROC = 4,
WH_CBT = 5,
WH_SYSMSGFILTER = 6,
WH_MOUSE = 7,
WH_HARDWARE = 8,
WH_DEBUG = 9,
WH_SHELL = 10,
WH_FOREGROUNDIDLE = 11,
WH_CALLWNDPROCRET = 12,
WH_KEYBOARD_LL = 13,
WH_MOUSE_LL = 14
}
[StructLayout(LayoutKind.Sequential)]
public struct KeyboardHookStruct
{
public int VirtualKeyCode;
public int ScanCode;
public int Flags;
public int Time;
public int ExtraInfo;
}
public delegate IntPtr HookProc(int nCode, IntPtr wp, IntPtr lp);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern IntPtr SetWindowsHookEx(HookType idHook, HookProc lpfn, IntPtr hInstance, uint threadId);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern bool UnhookWindowsHookEx(IntPtr hHook);
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern IntPtr CallNextHookEx(HookType idHook, int nCode, IntPtr wParam, IntPtr lParam);
}
接着是“忽略”:
public partial class Form1 : Form
{
private IntPtr kbhook = IntPtr.Zero;
private void Form1_Load(object sender, EventArgs e)
{
kbhook = WindowsAPI.SetWindowsHookEx(WindowsAPI.HookType.WH_KEYBOARD_LL, HandleKeyPress, IntPtr.Zero, 0);
if (kbhook == IntPtr.Zero)
Application.Exit();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
WindowsAPI.UnhookWindowsHookEx(kbhook);
}
private IntPtr HandleKeyPress(int nCode, IntPtr wp, IntPtr lp)
{
WindowsAPI.KeyboardHookStruct MyKeyboardHookStruct =
(WindowsAPI.KeyboardHookStruct)Marshal.PtrToStructure(lp, typeof(WindowsAPI.KeyboardHookStruct));
var key = (Keys)MyKeyboardHookStruct.VirtualKeyCode;
// **********************************
// if the pressed key is Keys.NumPad8
if (key == Keys.NumPad8)
{
button1_Click(null, EventArgs.Empty);
}
return WindowsAPI.CallNextHookEx(WindowsAPI.HookType.WH_KEYBOARD_LL, nCode, wp, lp);
}
}
pinvoke.net 密码样本可能已经过时,但有助于了解方法签名。
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...
Since I cannot order my dictionary, what is the best way of going about taking key value pairs and also maintaing an index?
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...