I have a C# application that needs to retrieve a bunch of information from another window that was written in C++ using MFC. The C# app is a plugin to a product containing this other window so they are both running within the same process.
This other window contains a number of fields that I have successfully gotten the strings from by calling:
[DllImport( "user32.dll", SetLastError = true )]
public static extern uint GetDlgItemText( IntPtr hDlg, int nIDDlgItem, [Out] StringBuilder lpString, int nMaxCount );
But it also contains 2 list controls that may contain a number of rows of data, each with a number of columns.
How do I fetch this data?
Is there another function in user32.dll I should be using?
Can you get a handle to the list control using:
[DllImport( "User32", SetLastError = true )]
public static extern IntPtr GetDlgItem( IntPtr hwndParent, int ItemId );
and then somehow cast it into a .NET control that you can get the rows and columns from?