public static bool KillFocus() { var helperAutomation = new HelperAutomation(); var focusControlHandle = helperAutomation.GetFocusControlHandle(); Win32Declares.Message.SendMessage(focusControlHandle, Win32Constants.Focus.WM_KILLFOCUS, IntPtr.Zero, IntPtr.Zero); return(helperAutomation.GetFocusControlHandle() != focusControlHandle); }
public static void SetText(string text) { var automation = new HelperAutomation(); IntPtr focusControlHandle = automation.GetFocusControlHandle(); SetText(focusControlHandle, text); }
/// <summary> /// paste clipbard data /// </summary> /// <param name="mainWindowHandle">the widbow that contains the control in which the data is going to be pasted</param> public static void PasteFromClipBoard(IntPtr mainWindowHandle) { WindowAutomation.ForceWindowToForeground(mainWindowHandle); var helperAutomation = new HelperAutomation(); IntPtr focusControlHandle = helperAutomation.GetFocusControlHandle(); Win32Declares.Message.SendMessage(focusControlHandle, Win32Constants.Clipboard.WM_PASTE, IntPtr.Zero, IntPtr.Zero); }
public static void SetReadOnly() { var helperAutomation = new HelperAutomation(); SetReadOnly(helperAutomation.GetFocusControlHandle()); }