Delphi TSendKeys FindWindowEx
Posted on 2007-10-04
I am using a TSendKeys object to send create a virtual user to do data entry. For most windows this works fine - we set the handle to the main window and then run our functions.
However, I have a case where I need to touch a child window in another application. I can get the handle and set the focus on the main window - but it has a separate meaning for Alt-V than the child window within the app. I tried using FindWindowEx but I don't think I am passing the right parameters.
Here is my code so far - but it keeps returning chandle = o
handle := SendKeysMacro.HandleFromTitle(FindWindowTitle(FMacro.ValueFromIndex[nLine -1]));
chandle := FindWindowEx(handle, 0, PChar('WINDOW'), nil);//PChar(FMacro.ValueFromIndex[nLine]));
I think the third parameter is my issue - but I don't know - I'm not sure what lpszClass this is supposed to be and I can't seem to find a listing of options for this field either. Most of the other questions I have seen related to this want to press a button in another app or something, not set the focus on a child window.
Any help is appreciated!