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什么的还没有学习到。
还有这段我如果要在一个程序中加入这段代码要放在哪里

解决方案 »

  1.   

    还有API相关的有上面简单一些的例子
    让人好理解的么
      

  2.   

    msdn上有RegisterHotKey函数的说明protected override 这句什么意思呢 :这个是重载了
    ref Message m 什么意思:引用调用,大体上应该是传递过来的windowos消息具体看msdn,比我说的更详细、得体
      

  3.   

    const int WM_HOTKEY = 0x0312; //这段函数什么意思
    定义一个消息protected override void WndProc(ref Message m) //protected override 这句什么意思呢 ref Message m 什么意思
    重载WndProc,这个参数是传递的消息你需要了解一下消息的传递,别问来问去的了