Hello,
I wonder how it would be possible to get text from a datagridview in another form application? The datagridview has 5 rows and 5 columns with text in each cell.
I know that this could be achieved with windows API but googling around I have not understand how to actually do this.
My beginning of code finds the application and in somehow we would return all childcontrols that exists to find the datagridview and extract text from the cells?
[DllImport("user32.dll")]
private void button15_Click(object sender, EventArgs e)
{
foreach (Process clsProcess in Process.GetProcesses())
{
//We found the application
if (clsProcess.MainWindowTitle.ToString().ToLower().Contains("nameofapplication"))
{
//Now how will we find the datagridview and extract text from the cells?
Process[] processes = Process.GetProcessesByName(clsProcess.ProcessName);
foreach (Process p in processes)
{
}
}
}
}