日期:2014-05-18  浏览次数:20944 次

如何发送小键盘的1.不是数字键1
我在自己做一个换键的程序.玩游戏的时候可以改 <快捷键>

这个是我的代码

namespace   testKey
{
        public   partial   class   Form1   :   Form
        {
                public   Form1   ()
                {
                        InitializeComponent   ();
                        RegisterHotKey   (   Handle,   100,   0,   Keys.Q   );
                }


                [DllImport   (   "user32.dll "   )]
                public   static   extern   bool   RegisterHotKey   (   IntPtr   hWnd,
                        int   id,   uint   fsModifiers,   Keys   vk   );

                [System.Runtime.InteropServices.DllImport   (   "user32.dll "   )]
                public   static   extern   bool   UnregisterHotKey   (   IntPtr   hWnd,   int   id   );

                public   enum   KeyModifiers
                {
                        None   =   0,
                        Alt   =   1,
                        Control   =   2,
                        Shift   =   4,
                        Windows   =   8
                }

                protected   override   void   WndProc   (   ref   Message   m   )
                {
                        const   int   WM_HOTKEY   =   0x0312;    
                        switch   (m.Msg)
                        {
                                case   WM_HOTKEY:
                                        ProcessHotkey   (   m   );
                                        break;
                        }
          &n