• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1037
  • Last Modified:

How to get text from Internet Explorer Address Bar to vb6 TextBox .....

Hi,
I've a problem, i want source code, how to get text from Internet Explorer AddressBar to Textbox in Visual Basic 6 e.g: when user enter some url eg www.hotmail.com then I want to capture this url address on click or change event.  


Waiting for ur positive and nice response.           Thanks
0
AsifBangash
Asked:
AsifBangash
  • 3
  • 3
1 Solution
 
Ryan ChongCommented:
See this by Ark if make help:

Receive Events from and Send Events to Open IE Windows
http://www.freevbcode.com/ShowCode.Asp?ID=1606
0
 
AsifBangashAuthor Commented:

Dear Ryancys,

thx for reply but i want it in text box and i m saving it in database when textbox got text from it. and that will be unvisible to user.
0
 
AsifBangashAuthor Commented:
Dear Ryancys,

thx for reply but i want it in text box and i m saving it in database when textbox got text from it. and that will be unvisible to user.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Ryan ChongCommented:
Hi,

If you mean grab the web page content, you can try below suggestions:

1st: Try use the URLDownloadToFile API

Example:

Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    Dim lngRetVal As Long
    lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
    If lngRetVal = 0 Then DownloadFile = True
End Function

Private Sub Form_Load()
    Randomize
    rndkey = Int(Rnd * 100000")
    URL = "http://www.abc.com/pass_management/user_auth.php?name=USERNAME&pass=PASSWORD" & "&rndkey=" & rndkey
    DownloadFile URL , "c:\test.txt"
End Sub

also:

Ensuring URLDownloadToFile Bypasses a Cached File Copy
http://vbnet.mvps.org/code/internet/urldownloadtofilenocache.htm

2nd: Using M$ Internet Transfer Control ActiveX. You can select it from Components, where it got a method called openURL which do exact the same above to retrive data from an URL.

Example:

mydata = Inet1.OpenURL(url)

and then we can display the web page content into textbox, and save into database, etc.

Hope this helps
0
 
Ryan ChongCommented:
See this recent PAQ as well : http:Q_21178962.html

where Erick37 suggested solution as follows:

...
Dim ie As Object
    Set ie = CreateObject("InternetExplorer.Application")
    ie.Navigate "http://msdn.microsoft.com"
    Do While ie.ReadyState <> READYSTATE_COMPLETE
        DoEvents
    Loop
    Debug.Print ie.StatusText
    Debug.Print ie.LocationName
    Debug.Print ie.LocationURL
    ie.Quit
    Set ie = Nothing
...
0
 
AsifBangashAuthor Commented:
Dear Ryancys,

Thanks for hep me. Your first help is right for me and i m Accepted ur first answer.

ok I do it means capture text from internetexplorer to Textbox of visual Basic 6.0. any way thaks.

like to mail me on my account (asifbangash at gmail.com)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now