I'm using EnumChildWindwos to find the control I'm looking for, then read the caption of the control using WM_GETTEXT.
1 2 3 4 5 6 7 8 9
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) {
TCHAR param[1000];
LONG lResult;
char display[1024] = "";
lResult = SendMessage(hwnd,WM_GETTEXT,1000,(LPARAM)display);
printf(display);
returntrue; // must return TRUE; If return is FALSE it stops the recursion
}
That does indeed find the control, but it only returns the First character of the char array, obviously i don't know enough of how to get the full string out. Can I get some help with syntax?
Likely due to mixing c-string data types, webJose wrote a nice post on the issue that I think you should read:- http://www.cplusplus.com/forum/general/56526/#msg304164
I think sloppy9 pretty much nailed this because WM_GETTEXT is below WM_USER and therefore the OS will do all the memory marshaling, and I suspect it also does ANSI/UNICODE conversion as well.