コード例 #1
0
 /// <summary>
 /// Simulates pressing a key
 /// </summary>
 /// <param name="hWindow"></param>
 /// <param name="key"></param>
 public static void PressKey(IntPtr hWindow, System.Windows.Input.Key key)
 {
     Win32.PostMessage(hWindow, Win32.WM_KEYDOWN,
                       (IntPtr)System.Windows.Input.KeyInterop.VirtualKeyFromKey(key),
                       IntPtr.Zero);
     //Win32.PostMessage(hWindow, Win32.WM_KEYUP,
     //                  (IntPtr)System.Windows.Input.KeyInterop.VirtualKeyFromKey(key),
     //                  IntPtr.Zero);
 }
コード例 #2
0
 private Boolean isHandledKey(System.Windows.Input.Key key)
 {
     return(key == Key.Delete || key == Key.Space || (key >= Key.A && key <= Key.Z));
 }