BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Click in a button on TWebBrowser

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
viana
Guest





PostPosted: Tue May 15, 2007 4:48 am    Post subject: Click in a button on TWebBrowser Reply with quote



Hello,

Is there a way to simulate a click in a button in a page loaded by TWebBrowser ? I know i can simulate the mouse click, but i'd like to simulate the click in the button without positioning the mouse in this button.

Thanks,
Viana
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue May 15, 2007 4:54 am    Post subject: Re: Click in a button on TWebBrowser Reply with quote



"viana" <v (AT) v (DOT) com> wrote in message
news:4648f55b$1 (AT) newsgroups (DOT) borland.com...

Quote:
Is there a way to simulate a click in a button in a
page loaded by TWebBrowser ?

Yes. After the page has been loaded, you can query the browser's
Document property for the IHTMLDocument2 interface, drill through the
DOM interfaces until you find the button you are interested in, query
it for the IHTMLElement interface, and then call its click() method.

Refer to MSDN for more details:

Interfaces and Scripting Objects
http://msdn2.microsoft.com/en-us/library/Aa741322.aspx

IHTMLDocument2 Interface
http://msdn2.microsoft.com/en-us/library/aa752574.aspx

Go to http://www.deja.com and search through the newsgroup archives
for examples that have been posted many times before.


Gambit
Back to top
Eddie Shipman
Guest





PostPosted: Tue May 15, 2007 7:00 pm    Post subject: Re: Click in a button on TWebBrowser Reply with quote



viana wrote:

Quote:

Hello,

Is there a way to simulate a click in a button in a page loaded by
TWebBrowser ? I know i can simulate the mouse click, but i'd like to
simulate the click in the button without positioning the mouse in
this button.


Well, first off, you cannot use mouse messages with TWebBrowser to
click on a button.

Second, if the button submits a form, it is much easier to use the
syntax: document.forms['formname'].submit .vs clicking the button
through the DOM.



--
Back to top
viana
Guest





PostPosted: Tue May 15, 2007 9:46 pm    Post subject: Re: Click in a button on TWebBrowser Reply with quote

thank you guys for your answers.
i've got a solution thanks to you :)

"Eddie Shipman" <mr_delphi_developer (AT) nospamyahoo (DOT) com> wrote:
Quote:
viana wrote:


Hello,

Is there a way to simulate a click in a button in a page loaded by
TWebBrowser ? I know i can simulate the mouse click, but i'd like to
simulate the click in the button without positioning the mouse in
this button.


Well, first off, you cannot use mouse messages with TWebBrowser to
click on a button.

Second, if the button submits a form, it is much easier to use the
syntax: document.forms['formname'].submit .vs clicking the button
through the DOM.



--
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.