Пример #1
0
        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);
        }
Пример #2
0
        public static void SetText(string text)
        {
            var    automation         = new HelperAutomation();
            IntPtr focusControlHandle = automation.GetFocusControlHandle();

            SetText(focusControlHandle, text);
        }
Пример #3
0
        /// <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);
        }
Пример #4
0
        public static void SetReadOnly()
        {
            var helperAutomation = new HelperAutomation();

            SetReadOnly(helperAutomation.GetFocusControlHandle());
        }