?
Solved

Writing to a frmWebpage that is hidden

Posted on 2003-03-20
17
Medium Priority
?
259 Views
Last Modified: 2010-04-07
I have this VB program that loads a frmwebpage (when a timer goes off) as hidden and once it is 'completly loaded' it appears and a login shows. This webpage takes quiet a while to load, thus hidden. This program also has the persons username and a saved ciphered password that will be entered on the webpage.

What I would like to do is to enter this username and password, hidden, and again have my program wait for the page to load. Once loading is complete then display.

Is there a way to 'Sendkey' to a hidden webpage? Maybe some API routine or...

thanks,

0
Comment
Question by:bioelectric
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 4
  • +3
17 Comments
 
LVL 14

Expert Comment

by:CyrexCore2k
ID: 8175854
I'm assuming frmWebpage has a Webbrowser control in it. If this is the case then you should be able to use the Webbrowser api like so:

frmWebpage.<webbrowsername>.document.<formname>.<fieldname>.value = "My val"

Where formname is the name of the form on the webpage and fieldname is the name of the field inside the form. So if you had the following in the webpage:

- Start Code -
<FORM ACTION="wherever.html" Name="LoginForm" Method="Post">
<INPUT TYPE="TEXT" NAME="Username">
<INPUT TYPE="TEXT" NAME="Password">
</FORM>
- End Code -

To fill those fields and to submit the form you would use the following statements:

frmWebpage.<webbrowsername>.document.LoginForm.Username.value = "John"
frmWebpage.<webbrowsername>.document.LoginForm.Password.value = "Smith"
frmWebpage.<webbrowsername>.document.LoginForm.Submit


Hope this helps
Spencer Ruport

0
 

Author Comment

by:bioelectric
ID: 8175996
Spence,
I only wish it was that easy. The browser is mine, but the page that it loads is not mine. It has applets and java, etc, etc. It must download a program each time, which is why it takes so long to download the page (& run it?) Here is the code from a capture of the page.
<HTML>
<HEAD>
<title>WebET on Windows with IE</title>
</HEAD>
<BODY>
<APPLET
code = "webet.WebET"
codebase = "classes"
WIDTH = 710
HEIGHT = 455>
<PARAM NAME = "cabbase" VALUE = "WebET.cab">
<PARAM NAME = "Backend" VALUE = "IS">
</APPLET>
</BODY>
</HTML>

What I am currently using is SendKey which works, but then the page has to open up again and takes 1-2 minutes more to load up. So I would like to logon to the page when it is still hidden.

Can I pass a windows messageAPI, or sendmsg to the selected hidden browser?  Something like Sendkeys for a visable browser?  Must be someway of doing this...

thank!
0
 
LVL 14

Expert Comment

by:CyrexCore2k
ID: 8176369
Oh I see... hmmm... I never use sendkeys so I can't help you there. Could you give me the url of this page? There might be some other alternative.

Thanks

Spencer
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:CyrexCore2k
ID: 8176403
Oh I see... hmmm... I never use sendkeys so I can't help you there. Could you give me the url of this page? There might be some other alternative.

Thanks

Spencer
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8176886
just a question: Do you have to populate inside a java applet or a simple html form?
0
 
LVL 14

Expert Comment

by:CyrexCore2k
ID: 8177546
He needs to populate some fields inside a Java applet. I was thinkin' he could make a local mock of the page that would download the app and then be able to pass a param to the applet.

Spencer Ruport
0
 

Author Comment

by:bioelectric
ID: 8180776
I was thinking of maybe using SendMessage to see if it can send a message to a hidden form. Only it is not only hidden but the page is running an applet (which is hidden by the hidden browser) which needs to be populated with logon username and password.

Maybe something like:
SendMessage hwnd, WM_CHAR, vbKeyReturn, Byval 0 ?
Never used these before, but I suspect that it also will not work.
This maybe an open end question...  as I have no clue about filling in applets with VB.
v/r
Ken Carrigan
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8180803
Ok. we are there know.
I know how to populate an applet:

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8180990
Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WB1.Object) Then
    Set wbDoc = WB1.Document
    Dim j As HTMLObjectElement
    Set j = wbDoc.applets.Item(1)
   
End If
End Sub

j is the applet. You could inspect the applet and locate each "text box" and set the values.
If you have the url, i could write the code.
0
 

Author Comment

by:bioelectric
ID: 8181590
Richie,
Here is the HTML page and a snipped of my code. http://hq-et1.anteon.com/webET/ie4Win.html

I can't give you usernames or password but you test out placing test in it. Appreachiate you looking into this.
Once this Bowser completed is called it is SHOWN. I'd like it to still be hidden and logon generated, then once again wait for a completed document command.
v/r
Ken Carrigan
'------------------------Here's my program thus far--
Private Sub brwWebBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim lR As Long
Dim lpReTurnString As String
Dim pswd As String
Dim directoryname$

    On Error Resume Next
'In this webpage the user has to put username in and password.
   
If FirstT = False Then Exit Sub   'This is used for 'other' browsing beside WEBET

directoryname$ = App.Path
If Right$(directoryname$, 1) <> "\" Then directoryname$ = directoryname$ + "\"
fname = directoryname$ & "Alarm.ini"

' Obtains Username & crypted Password from INI file
 
lpReTurnString = Space(50) 'place to put returned values
GetPrivateProfileString "User", "UserName", "NONE", lpReTurnString, 50, fname
lpReTurnString = Left$(RTrim$(lpReTurnString), Len(RTrim$(lpReTurnString)) - 1)
   
If lpReTurnString = "NONE" Then Exit Sub  'no LOGON information was given

SendKeys lpReTurnString, True
SendKeys "{TAB}", True
.....
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8191806
For a reason, i cannot get the textboxes inside the applet.
0
 

Expert Comment

by:CleanupPing
ID: 8531920
Hi bioelectric,
This old question (QID 20557732) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8982600
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in a week or two.  I would appreciate any comments by the experts that would help me in making a recommendation.
It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp

GPrentice00
Cleanup Volunteer
0
 

Author Comment

by:bioelectric
ID: 8985488
GPrentice00,
Can you help me delete the question? I've never done this before (deleting) and am lost. Never did get an answer, maybe what I wanted can not be done. Populating a web applet that is hidden was what I was looking for... Thanks for any help in clearing this out.
v/r
Bioelectric
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9046018
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->PAQ - with points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9046053
bielectric

There was a lot of good information here that would be a shame to discard, even though none of this generally applicable code did actually work in the specific applicable scenario presented, so once it was determined that there was an impasse, and this wasnt going any further, a request could have been made in Community Support - even a requst for a moderator to offer an opinion on the action to close out.  Can't go wrong with that approach...

0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9140777
Question is PAQ'd and points refunded.

YensidMod
Community Support Moderator @Experts Exchange
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

752 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