コード例 #1
0
 public static void PressKeys(IntPtr hWnd, params Key[] keys)
 {
     foreach (var key in keys)
     {
         UIAutomationHelper.PressKey(hWnd, key);
     }
 }
コード例 #2
0
 /// <summary>
 /// Simulates pressing several keys
 /// </summary>
 /// <param name="hWindow"></param>
 /// <param name="keys"></param>
 public static void PressKeys(IntPtr hWindow,
                              IEnumerable <System.Windows.Input.Key> keys)
 {
     foreach (var key in keys)
     {
         UIAutomationHelper.PressKey(hWindow, key);
     }
 }
コード例 #3
0
        static void Main(string[] args)
        {
            Console.ReadLine();
            var hWnd = UIAutomationHelper.FindChildWindow("Untitled - Notepad2-mod", "SysListView32");

            hWnd = (IntPtr)0x3080A;
            UIAutomationHelper.PressKeys(hWnd, Key.H, Key.E, Key.L, Key.L, Key.O);
            Console.ReadLine();
        }
コード例 #4
0
 /// <summary>
 /// Finds a window specified by the window title and set focues on that window
 /// </summary>
 /// <param name="windowName"></param>
 /// <returns></returns>
 public static IntPtr FindWindowAndFocus(string windowName)
 {
     return(UIAutomationHelper.FindWindowAndFocus(null, windowName));
 }
コード例 #5
0
 /// <summary>
 /// Finds a child window
 /// </summary>
 /// <param name="windowName"></param>
 /// <param name="childWindowName"></param>
 /// <returns></returns>
 public static IntPtr FindChildWindow(String windowName, String childWindowName)
 {
     return(UIAutomationHelper.FindChildWindow(null, windowName, null, childWindowName));
 }