using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Windows.Forms; namespace ViberMess { public partial class Form1 : Form { // Get a handle to an application window. [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); // Activate an application window. [DllImport("USER32.DLL")] public static extern bool SetForegroundWindow(IntPtr hWnd); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { // Get a handle to the viber application. The window class // and window name were obtained using the Spy++ tool. IntPtr calculatorHandle = FindWindow("Qt5QWindowIcon", "Viber +2xxxxxxxxx"); // Verify that Viber is a running process. if (calculatorHandle == IntPtr.Zero) { MessageBox.Show("Viber is not running."); return; } // Make Viber the foreground application and send it // phone number SetForegroundWindow(calculatorHandle); //Send CTRL+d to open dialled windows SendKeys.SendWait("^d"); //Pass phone number SendKeys.SendWait("+2010xxxxxxxx"); //Here is i want to click on message logo then type text and press Enter //My problem how to click on message logo to type text } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)