THANASIS FARANTOS
asked on
sending data to dialog box with sendkeys
I want to hadlle a dialog box in order to automatically download a file from a web page (using delphi and Twebbrowser).
So I wrote a code like this ...
First line seems to work (focus moves from cancel button to save button) , but the second line doesn't (save button is not triggered).
Strangely, if i write...
SimulateKeystroke(VK_RETUR N, 0) seems to work, (dialog box is closed, so cancel button is triggered)
I tried some tricks like using SimulateKeystroke(VK_RETUR N, 0) repetetively in a loop, or insert delay in the code, but without result.
How can I fix this?
So I wrote a code like this ...
procedure WebBrowserDownloadComplete(Sender: TObject);
begin
SimulateKeystroke(VK_LEFT, 0);
SimulateKeystroke(VK_RETURN, 0);
end;
First line seems to work (focus moves from cancel button to save button) , but the second line doesn't (save button is not triggered).
Strangely, if i write...
procedure WebBrowserDownloadComplete(Sender: TObject);
begin
SimulateKeystroke(VK_RETURN, 0);
end;
SimulateKeystroke(VK_RETUR
I tried some tricks like using SimulateKeystroke(VK_RETUR
How can I fix this?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Here are few articles to help you out:
calling JS functions
Delphi and WBrowser