How do I send info to another program with Visual Basic 6?

Okay, is it possible to...
-open a internet window
-send text to a text box in the window
-press a command button in the window
-reload the window to a URL

Please answer one or all the questions.

Who is Participating?
MattiConnect With a Mentor Commented:
Using sendkeys etc. does not give a sure results but You need to use own webbrowser control in this if it will due:
It's very similar in VB 6 this one is asked in .NET but it's on VB 6 area

In my frist comment there is a sbmit button click on that browser object.

IrTeh1337Author Commented:
Okay, I am trying to create a auto-log in--just like the example you gave.
Look at the code snippet,
Is it possible to use a web control to...
put text in the text box and then click the command button?
If that is any way possible with vb6 please reply.
It's JavaScript fyi.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
        <META http-equiv="Expires" content="0"/>
        <META http-equiv="pragma" content="no-cache"/>
        <META http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
        <META name="Expires" content="0"/>
        <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
        <link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon"/>
        <link rel="stylesheet" type="text/css" href="/reportCard/stylesheet.css"/>
    <title>PTSD Report Cards</title>
    <script type="text/javascript">
        function trapEnterKey(evt)
            var keycode;
            //noinspection StatementWithEmptyBodyJS
            if (evt)
            else if (window.event)
                evt = window.event;
            else if (event)
                evt = event;
                return true;
            if (evt.charCode)
                keycode = evt.charCode;
            else if (evt.keyCode)
                keycode = evt.keyCode;
            else if (evt.which)
                keycode = evt.which;
                keycode = 0;
            if (keycode == 13)
                return false;
                return true;
<body onload="document.forms[0].elements['loginForm:userNameInput'].focus();" onkeypress="trapEnterKey(event);">
  <script type="text/javascript">var _AdfWindowOpenError='A popup window blocker has been detected in your browser. Popup blockers interfere with the operation of this application. Please disable your popup blocker or allow popups from this site.';</script><script type="text/javascript" src="/reportCard/adf/jsLibs/Common1_0_7.js"></script><form id="loginForm" name="loginForm" method="POST" onkeypress="return _submitOnEnter(event,'loginForm');" action="/reportCard/pages/login.jsf">
  <table border="0" cellpadding="3" cellspacing="3" class="panel"><tbody><tr><td><img src="/reportCard/images/ptsdLogo.jpg" alt="Welcome to Mayet Report Cards" title="Welcome to PTSD Report Cards"></td></tr>
<tr><td><table align="CENTER" border="0" cellpadding="3" cellspacing="3" class="panel"><tbody><tr><td><table border="0" cellpadding="5" cellspacing="3">
<thead><tr><th class="login-heading" scope="colgroup" colspan="3">
PTSD Report Cards
<tr><td><label class="label" for="loginForm:userNameInput"><span class="label">Enter your user name:</span></label></td><td><input id="loginForm:userNameInput" name="loginForm:userNameInput" type="text" value="" maxlength="30" size="20" class="textField" tabindex="0"></td><td></td></tr>
<tr><td><label class="label" for="loginForm:passwordInput"><span class="label">Password:</span></label></td><td><input type="password" id="loginForm:passwordInput" name="loginForm:passwordInput" maxlength="20" size="20" class="textField"></td><td></td></tr>
<tr><td></td><td><input id="loginForm:loginButton" name="loginForm:loginButton" type="submit" value="Login" onclick="submitForm('loginForm',1,{source:'loginForm:loginButton'});return false;" class="button"></td><td></td></tr>
<input type="hidden" name="org.apache.myfaces.trinidad.faces.FORM" value="loginForm"><span id="tr_loginForm_Postscript"><input type="hidden" name="org.apache.myfaces.trinidad.faces.STATE" value="!8c2b464"><script type="text/javascript">function _loginFormValidator(f,s){return _validateInline(f,s);}var loginForm_SF={};</script></span><script type="text/javascript">_submitFormCheck();</script></form>

Open in new window

IrTeh1337Author Commented:
Yeah I used the link for the code. Happy: :P
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.