Thanks a lot for the AutoIt link.
As I suspected, it is using SendMessage with %WM_SETTEXT message
ResultType Line::ControlSetText(char *aControl, char *aNewText, char *aTitle, char *aText
, char *aExcludeTitle, char *aExcludeText)
{
g_ErrorLevel->Assign(ERRORLEVEL_ERROR); // Set default ErrorLevel.
HWND target_window = DetermineTargetWindow(aTitle, aText, aExcludeTitle, aExcludeText);
if (!target_window)
return OK;
HWND control_window = ControlExist(target_window, aControl); // This can return target_window itself for cases such as ahk_id %ControlHWND%.
if (!control_window)
return OK;
// SendMessage must be used, not PostMessage(), at least for some (probably most) apps.
// Also: No need to call IsWindowHung() because SendMessageTimeout() should return
// immediately if the OS already "knows" the window is hung:
DWORD result;
SendMessageTimeout(control_window, WM_SETTEXT, (WPARAM)0, (LPARAM)aNewText
, SMTO_ABORTIFHUNG, 5000, &result);
DoControlDelay;
return g_ErrorLevel->Assign(ERRORLEVEL_NONE); // Indicate success.
}
I think the trick is inside ControlExist function. It should be able to enumerate though all child controls even if in between the main windows and the needed control there are hidden windows like in the case of XARA where the Edit control you want to change is inside other two parent windows.
I will see what I can do. It is quite interesting having something similar.
Ciao
Eros
Bookmarks