We help IT Professionals succeed at work.

Delphi TSendKeys FindWindowEx

Chipmunk77 asked
Last Modified: 2010-05-18
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!

Watch Question

Senior Developer
Unlock this solution and get a sample of our free trial.
(No credit card required)
CodedKSenior Software Engineer
Unlock this solution and get a sample of our free trial.
(No credit card required)
Forced accept.

EE Admin

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.