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
LVL 1
AsifBangashAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
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 ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.