I want to read a 'DataGridView' of an application. There is an application in which many child windows are there. Here is a picture of that application and the window containing the datagridview which I want to read, I've highlighted the window which I want to read
I've searched the window through UISPY and here is the picture of the window and datagridview in it. I've highlighted the control which I want to be read.
I've used this code(Winapi) to read the control but I am getting an empty string
public object WindowText(IntPtr hWnd)
{
object obj2 = "";
if (hWnd.Equals(IntPtr.Zero))
{
return "";
}
// 0x111 is WM_COMMAND
MainModule.SendMessage(hWnd, 0x111, (IntPtr)0x81eb, IntPtr.Zero);
MainModule.StrData = MainModule.StrData + Clipboard.GetText();
// 0x307 is WM_DESTROYCLIPBOARD
MainModule.SendMessage(hWnd, 0x307, IntPtr.Zero, IntPtr.Zero);
return obj2;
}
I've also tried UI Automation but i didn't succeed in reading through it also.
The datagridview has some cells which are updated every second(Live data) and I want to read it and store it.
I want to read the the cells and columns(Symbol,Bid,Ask) and the cell contents(AUDCAD,AUDCHF) etc.