Beispiel #1
0
        private void btnEnviarClique_Click(object sender, EventArgs e)
        {
            IntPtr hwnd     = getHandleProcessComboBox();
            IntPtr hwndView = IntPtr.Zero;

            int p;

            if (int.TryParse(txtNomeButton.Text, out p))
            {
                hwndView = new IntPtr(p);
            }
            else
            {
                hwndView = SearchHandle.GetChildWindowHandle(txtNomeButton.Text, "WindowsForms10.BUTTON", hwnd);
            }

            if (hwndView != IntPtr.Zero)
            {
                SendAction.SendClick(hwndView);
            }
        }
Beispiel #2
0
        private void btnAlterarTextoEdit_Click(object sender, EventArgs e)
        {
            IntPtr hwnd     = getHandleProcessComboBox();
            IntPtr hwndView = IntPtr.Zero;

            int p;

            if (int.TryParse(txtNomeButton.Text, out p))
            {
                hwndView = new IntPtr(p);
            }
            else
            {
                hwndView = SearchHandle.GetChildWindowHandle(txtNomeButton.Text, "WindowsForms10", hwnd);
            }

            if (hwndView != IntPtr.Zero)
            {
                SendAction.SendText(hwndView, "caio");
                //o restante dos componentes que nao forem textbox, precisam ser minimizado e maximizados para atualizarem.
                ShowWindow(hwndView, SW_MINIMIZE);
                ShowWindow(hwndView, SW_RESTORE);
            }
        }