I have code that launches an external application and automatically fills in a password prompt.
I want to automate the pressing of the "ENTER" key, so that the user does not have to click "OK".
How can I send the ENTER key to an external application?
Below is my code as it stands right now.
The first line to post the password to the application works fine.
The second line to send an ENTER key press has no effect at all.
I am using Delphi 2010.
//now that we have the control handle, send the password to it
SendMessage(AppHandle,WM_SETTEXT,0,Integer(PChar(pwd)));
//and now push ENTER
SendMessage(AppHandle,WM_KEYDOWN,0,Integer(PChar(#13)));
Try this
PostMessage(AppHandle, WM_KEYDOWN, VK_RETURN, 0);
Bye.