automated login help on a web page using sendkeys or appactivate on windows vista

Posted on 2007-08-02
Last Modified: 2008-02-01
Hi i have been trying to write a little app that will sit in taskbar and open a browser control and login to a website, its part of a new authentication system our central network group has done.
basically from what im seeing sendkeys no  longer works in vista which makes things more difficult :( as im not overly familiar with api calls etc so if anyone can help itd be greatly appreciated.

basically i have a form, Form1 it has a webrowser control which loads our auth page there are 2 textboxes on the page "username" and "password which i need to enter data in and click the submit button.

if anyone can assist or point me in the right direction itd be greatly appreciated
Question by:dadd0012
    LVL 19

    Expert Comment

    How about this:
        WebBrowser1.Document.GetElementByID("username").InnerText = "rgurskis"
        WebBrowser1.Document.GetElementByID("password").InnerText = "rimrimrim"

    Author Comment

    OMG i cant believe it wass that simple lol i was looking at api calls etc etc the only other prob i now have is that it opens a heartbeat page in a new window is there a way to force that to either open in same or webbrowser2 ?
    LVL 19

    Accepted Solution

    In general, when handling new windows, you should create new form with a WebBrowser control.
    Take a look here:
    How To Use the WebBrowser Control NewWindow2 Event

    But if you still want to display pop-up in same control or on another control in same form, you could use this approach:
    How To Cause Navigation to Occur in Same WebBrowser Window

    Note that this SHOULD have worked with IE versions up to 5.5. But it still works with IE7. Not sure if SHDocVwCtl.WebBrowser_V1 class will be supported in future versions.

    I would use first method with new forms.


    Author Comment

    thanks for the help that worked great i went with the 2nd option but it works great thanks again you have made my day :)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now