using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern UInt32 RegisterHotKey(IntPtr hWnd, UInt32 id, UInt32 fsModifiers, UInt32 vk);
//API的开头能帮忙解释一下么
public Form1()
{
InitializeComponent();
RegisterHotKey(this.Handle, 247696411, 0, (UInt32)Keys.F10);
}
protected override void WndProc(ref Message m) //protected override 这句什么意思呢 ref Message m 什么意思
{
const int WM_HOTKEY = 0x0312; //这段函数什么意思
if (m.Msg == WM_HOTKEY && m.WParam.ToInt32() == 247696411)
{
}
base.WndProc(ref m);
}
能帮忙注释清楚一些么..
小弟刚学C#API什么的还没有学习到。
还有这段我如果要在一个程序中加入这段代码要放在哪里
[DllImport("user32.dll")]
public static extern UInt32 RegisterHotKey(IntPtr hWnd, UInt32 id, UInt32 fsModifiers, UInt32 vk);
//API的开头能帮忙解释一下么
public Form1()
{
InitializeComponent();
RegisterHotKey(this.Handle, 247696411, 0, (UInt32)Keys.F10);
}
protected override void WndProc(ref Message m) //protected override 这句什么意思呢 ref Message m 什么意思
{
const int WM_HOTKEY = 0x0312; //这段函数什么意思
if (m.Msg == WM_HOTKEY && m.WParam.ToInt32() == 247696411)
{
}
base.WndProc(ref m);
}
能帮忙注释清楚一些么..
小弟刚学C#API什么的还没有学习到。
还有这段我如果要在一个程序中加入这段代码要放在哪里
让人好理解的么
ref Message m 什么意思:引用调用,大体上应该是传递过来的windowos消息具体看msdn,比我说的更详细、得体
定义一个消息protected override void WndProc(ref Message m) //protected override 这句什么意思呢 ref Message m 什么意思
重载WndProc,这个参数是传递的消息你需要了解一下消息的传递,别问来问去的了