I have program that should read both textboxes and textlabels from another program. I'm retrieving the handle for the controls with EnumWindows and EnumChildWindows. First I tried the GetWindowsText which worked fine, but not with the Edit Boxes. So I'm now trying to use the WM_GETTEXT directly but with no better success.. I'm not getting any text at all..
Here is the code used:
function EnumTextChildProc(AHandle: hWnd; AnObject: TObject): BOOL; stdcall;
caption: array[0..3000] of Char;
Result := True;
SendMessage(AHandle, WM_GETTEXT, Sizeof(caption), integer(@caption));
s := Caption;
Any solutions or workarounds for this problem?
(using Win 8 and Delphi XE3)