我有启动外部应用程序并自动填写密码提示的代码。
我想自动按下“ENTER”键,这样用户就不必单击“确定”。
如何将 ENTER 键发送到外部应用程序?
下面是我现在的代码。
将密码发布到应用程序的第一行工作正常。
发送 ENTER 键的第二行根本没有任何效果。
我正在使用德尔福 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)));