I am making a program (program1) that will read the name of the columns of a header (SysHeader32) that is located in a report-style List (SysListView32) in another program (program2).
So basically I want my program to go into another program and read what the title name is for all the headers (SysHeader32) that I find. Since the program has a lot of different lists and headers for each list, I decided to use the EnumChildWindows
function with an EnumChildProc
callback function to look through all the handles of the child window. With those handles I use GetClassName()
to see what the class name is and when I see it is a SysHeader32, I know I found a header that can contain various title names... but I have no idea what code I can use to get the text from these various titles, nor do I know how to identify each title...
Here is the code I have so far that will find the handle for each SysHeader32 header found:
BOOL CALLBACK EnumChildProc (HWND hWnd, LPARAM lParam)
{
char myBuffer [100];//buffer that will get the class name
GetClassName(hWnd, myBuffer, 100);
string myString (myBuffer);//converting myBuffer into a readable string
if (myString == "SysHeader32")
{
///here is where I am currently lost
///I just don't know how to get the text from the different titles/items
///in the header found
}
}
Question 1:: How do I check how many different titles / items there are in the header?
Question 2:: How do I get the text for each of the titles / items found in the header?
Please provide some sample code.