Loading ...
Sorry, an error occurred while loading the content.

Re: Sending Keystrokes to the Browser

Expand Messages
  • MaX
    ... page ... (0).tagname); Because it is: webbrowser1.oleobject.document.forms.item(0).elements.item(0).tagname But I have also a question. Why does
    Message 1 of 8 , Jul 11, 2000
    View Source
    • 0 Attachment
      --- In delphi-webbrowser@egroups.com, "Anthony Lacey" <aclacey@n...>
      wrote:
      > I must have something else wrong because I had problems...
      > In my OnDocumentComplete I put the following... (And yes the web
      page
      > that first came up had a form)
      >
      > Doing...
      > showmessage(webbrowser1.oleobject.document.forms(0).item
      (0).tagname);

      Because it is:
      webbrowser1.oleobject.document.forms.item(0).elements.item(0).tagname


      But I have also a question. Why does
      webbrowser1.oleobject.document.forms.item(0).elements.item(0).click
      not work, if the input type is an image? At least in my program, I
      get Access violations ... With a button it works, but not with an
      image ...

      Any ideas ???
    • Henri Fournier
      According to the docs, click is supported for since IE4. http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/click.asp
      Message 2 of 8 , Jul 11, 2000
      View Source
      • 0 Attachment
        According to the docs, "click" is supported for <INPUT type="image"> since
        IE4.
        http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/click.asp

        So... in theory, if you're using IE4 or greater, it should work. Thing is,
        the docs say it fires the onclick event, doesn't say anything about causing
        a <FORM> submit. You might be better off doing:

        webbrowser1.oleobject.document.forms.item(0).submit;

        --
        Henri Fournier
        http://members.home.net/hfournier

        -----Original Message-----
        From: MaX [mailto:max_tcl@...]
        Sent: July 11, 2000 5:59 PM
        To: delphi-webbrowser@egroups.com
        Subject: [delphi-webbrowser] Re: Sending Keystrokes to the Browser


        --- In delphi-webbrowser@egroups.com, "Anthony Lacey" <aclacey@n...>
        wrote:
        > I must have something else wrong because I had problems...
        > In my OnDocumentComplete I put the following... (And yes the web
        page
        > that first came up had a form)
        >
        > Doing...
        > showmessage(webbrowser1.oleobject.document.forms(0).item
        (0).tagname);

        Because it is:
        webbrowser1.oleobject.document.forms.item(0).elements.item(0).tagname


        But I have also a question. Why does
        webbrowser1.oleobject.document.forms.item(0).elements.item(0).click
        not work, if the input type is an image? At least in my program, I
        get Access violations ... With a button it works, but not with an
        image ...

        Any ideas ???


        ------------------------------------------------------------------------
        In Europe, more than 219 million people will access Internet services
        using mobile phones by 2003, according to Forrester Research.
        Learn Wireless Development on
        http://click.egroups.com/1/6222/11/_/7783/_/963352756/
        ------------------------------------------------------------------------
      • juhehe@utu.fi
        ... I got some Access Violations too, but then I got it working. I found it working from INPUT-tags. So I want to click on the girl: ovElements :=
        Message 3 of 8 , Jul 25, 2000
        View Source
        • 0 Attachment
          > webbrowser1.oleobject.document.forms.item(0).elements.item(0).click
          > not work, if the input type is an image? At least in my program, I
          > get Access violations ... With a button it works, but not with an
          > image ...

          I got some Access Violations too, but then I got it working.
          I found it working from INPUT-tags. So I want to click on the girl:

          ovElements := WebBrowser1.OleObject.Document.all.tags('INPUT');
          for i := 0 to (ovElements.length - 1) do begin
          if (ovElements.item(i).type = 'image')
          then begin
          if (Pos('sexygirl.gif', ovElements.item(i).src) > 0 )
          then begin
          {click on center (148,148):}
          {ovElements.item(i).x := 148;
          ovElements.item(i).y := 148;}
          ovElements.item(i).click;
          end; {if..}
          end; {if..image}
          end; {for}

          Above click works, it submits the form, BUT, I need to click on the
          center of the form. My notation above is not correct (therefore
          commented out), but I must have my intention correct, see:
          http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/INPU
          T_image.asp
        Your message has been successfully submitted and would be delivered to recipients shortly.