Link to home
Start Free TrialLog in
Avatar of blackwolfvn82
blackwolfvn82

asked on

How to sendkeys backspace to tWEBBROWSER?help me please

procedure TForm1.Button7Click(Sender: TObject);
begin
form3.WebBrowser1.SetFocus
sendkeystotitle('search',SK_SHIFT_DN+SK_TAB+SK_SHIFT_UP+SK_PGDN+SK_TAB+SK_TAB+SK_TAB+SK_TAB+SK_TAB+'614035'+SK_ENTER);
sleep(2000);
sendkeystotitle('search',SK_BKSP);
end;

//SEARCH: is the caption of my form
this command is sucsesful
sendkeystotitle('search',SK_SHIFT_DN+SK_TAB+SK_SHIFT_UP+SK_PGDN+SK_TAB+SK_TAB+SK_TAB+SK_TAB+SK_TAB+'614035'+SK_ENTER);

but why this command sendkeystotitle('search',SK_BKSP); is not successfull.My webbrowser doesn't go back to the previous page
Ā 
thanks very much
Avatar of cmp3k
cmp3k

Hi,

Try replacing sendkeystotitle('search',SK_BKSP); with:

SendMessage(form3.WebBrowser1.Handle, WM_KEYDOWN, VkKeyScan(#8), 0);
SendMessage(form3.WebBrowser1.Handle, WM_CHAR, VkKeyScan(#8), 0);
SendMessage(form3.WebBrowser1.Handle, WM_KEYUP, VkKeyScan(#8), 0);
Avatar of blackwolfvn82

ASKER

sorry but My webbrowser still doesn't go back to the previous page
If you just want to navigate the browser back it would be easier to use the following line:
Form3.WebBrowser1.GoBack;
but can you explain why i can't use the function:
sendkeystotitle('search',SK_BKSP);
ASKER CERTIFIED SOLUTION
Avatar of geobul
geobul

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial