dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: activating imported webpage java in VB6

  1. #1
    Join Date
    Jul 2004
    Location
    St. Louis, Mo
    Posts
    111

    activating imported webpage java in VB6

    A web server has placed javascript onto my computer that I want to send commands to, so that I can change pages, etc.
    I have accessed the server from IE7 webbrowser implemented in VB6.
    I can manually click the screen, but I want to issue the equivalent of: javascript:switch('ab') using VB6.

    Thanks,

    Good software like good food takes time to prepare.
    Winnie-the-Pough (sic)
    Last edited by dmb-job; 11-27-2006 at 12:42 AM. Reason: color did not show well

  2. #2
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Do u ask about "Select case" method (equivalent to switch() method) ??
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Jul 2004
    Location
    St. Louis, Mo
    Posts
    111
    Amahdy's Response: "Do u ask about "Select case" method (equivalent to switch() method) ??"

    Thanks for answering. The VB6 "Select Case" will not solve my problem.

    The screen has a button that tells the Javascript to switch the display to change the contents on the screen without going back to the web site.
    I want to use VB6 to equivently click that button without having to perform any keyboard manipulation to locate the button, etc. I simply want to do something like SendKeys to the JavaScript. I want the equivalent of a CommandLine.




    Winnie-the-Pough
    Last edited by dmb-job; 11-27-2006 at 11:07 PM. Reason: Investigated the proposed solution and it doesn't work

  4. #4
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    My mail box show another reply

    Okey nice to search and know what I meant and now me two I know yours;

    As u r using IE7 you can try using :
    webB.Navigate2 () , webB.ExecWB () and webB.QueryStatusWB ()
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  5. #5
    Join Date
    Jul 2004
    Location
    St. Louis, Mo
    Posts
    111
    Another clue which may have the same solution.
    I want to also issue this command somehow from VB6 to equivalently click the button which in the JavaScript is:
    window.status = 'Minimize/Maximize Snapticket'; return true;
    I suspect this is very simple, so just give me clue as where to find out how to do this.

    Thanks once again,

    Winnei-the-Pough

  6. #6
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    U r using IE7 {or whatever} control right ?
    all u have to do is to change the parent form status or change the control .width , .height, .top & .left ...
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  7. #7
    Join Date
    Jul 2004
    Location
    St. Louis, Mo
    Posts
    111
    Maybe this is a better description of what I want to do.
    I used WebBrower to navigate and have a Web page visible which has JavaScript MouseClick events. I want to be able to trigger these events from VB6 code. Can this be done.

    This is similar, can it be made to function to Raising JavaScript Event from VB6

    Private Sub Control_MouseMove(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.MouseEventArgs) Handles mouseMove, Button1.MouseMove.
    Console.WriteLine("Control_MouseMove: " & DirectCast(sender, Control).Name)
    End Sub




    What do I use as the 'Panel1', 'sender' and 'Control' equivalent from the JavaScript.


    Good software like good food takes time to prepare.
    Winnie-the-Pough (sic)

  8. #8
    Join Date
    Jul 2004
    Location
    St. Louis, Mo
    Posts
    111
    I found this:
    http://keyword.netscape.com/ns/boomf...query=ms759132
    which explains clone Method
    Clones a copy of the current IXMLDOMSelection, with the same position and context.

    Code:
    Dim xmlDoc As New Msxml2.DOMDocument30
    Dim xpath As IXMLDOMSelection
    Dim xpath2 As IXMLDOMSelection
    Dim temp1 As IXMLDOMNode
    Dim temp2 As IXMLDOMNode
    xmlDoc.loadXML ("<root><elem1>Hello</elem1><elem2>World!</elem2></root>")
    If (xmlDoc.parseError.errorCode <> 0) Then
       Dim myErr
       Set myErr = xmlDoc.parseError
       MsgBox("You have error " & myErr.reason)
    Else
       ' Create an XMLDOMSelection object from selected nodes.
       Set xpath = xmlDoc.selectNodes("root/elem1")
       ' Cache the XPath expression and context.
       xpath.expr = "root/elem1"
       Set xpath.context = xmlDoc
       ' Clone the XMLDOMSelection object.
       Set xpath2 = xpath.Clone()
       Set temp1 = xpath.peekNode()    ' temp1 == <elem1/>
       MsgBox("temp1: " & temp1.xml)
       Set temp2 = xpath2.peekNode()   ' temp2 == <elem1/>
       MsgBox("temp2: " & temp2.xml)
       ' Note that position and context are maintained.
    End If
    It appears to me that this allows me to fetch the value from the screen DOM that is written by the JavaScript of the xmlDoc.loadXML. I had been using innerbody for this purpose.

    I find no examples of being able to Poke text using this or similar method. Is that possible?

    My original question was to be able to simulate a click without having to locate the positon on the screen.

    I can find the line in the JavaScript that initiates the 'onKeyUp=..."
    Can I somehow simulate that with a variation of the clone Method?

    Thanks

    Winnie-the-Pough

Similar Threads

  1. Java book
    By Lou in forum Java
    Replies: 9
    Last Post: 09-19-2007, 05:58 AM
  2. DevX does seem one sideded
    By Rob Abbe in forum Talk to the Editors
    Replies: 44
    Last Post: 01-13-2003, 03:57 PM
  3. Has Sun Given Up on the Desktop?
    By Lori Piquet in forum Talk to the Editors
    Replies: 114
    Last Post: 10-10-2002, 06:01 AM
  4. Re: ALERT - XP COULD DISABLE JAVA IN WEB BROWSERS AND EMAI L
    By Tim Romano in forum Talk to the Editors
    Replies: 1
    Last Post: 07-27-2001, 08:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center