Finally ... I tried to get the handle of utorrent control "Edit"(textbox)
And I succeded but now , How to use the handle to get text from the control "Edit" >>> This is the Problem for now.
----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices ;
using System.Diagnostics;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
IntPtr Program = new IntPtr(0);
IntPtr myControl = new IntPtr(0);
Program = FindWindow("µTorrent4823DF041B09", null);
if (Program.Equals(IntPtr.Zero))
label1.Text=("Notepad Not Running");
else
{
myControl = FindWindowEx(Program, IntPtr.Zero, "Edit", null);
if (myControl.Equals(IntPtr.Zero))
{
label1.Text = "µTorrent doesn't have an Edit component ?";
}
else
{
label1.Text = "Edit Control: " + myControl.ToString();
}