Results 1 to 5 of 5

Thread: Need to handle textbox and "Go" button of I.E.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    198

    Need to handle textbox and "Go" button of I.E.

    Hi everyboy, I need to manipulate the textbox for putting into it the url and the go button from my .Net application. Does anyone have some sample doing that? I'd be so greateful if anyone let me know how to do it.
    Thank you all in advance.

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Need to handle textbox and "Go" button of I.E.

    What exactly do you mean by manipulate? Enter a URL and make it go there? Could you explain a bit more?


    Has someone helped you? Then you can Rate their helpful post.

  3. #3

    Re: Need to handle textbox and "Go" button of I.E.

    yeah, you could use api to enter a URL, and then click "GO" or you could use the vb shell command and launch a new explorer window to the url you select, which are you trying to do?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    198

    Re: Need to handle textbox and "Go" button of I.E.

    I'm sorry if I didn't expressed so well, I need to do what you both said, enter a URL in the text box and then simulate a click on "GO" button.
    Can it be done with api?

  5. #5

    Re: Need to handle textbox and "Go" button of I.E.

    try this.

    VB Code:
    1. Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    2. Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    3. Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    4. Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    5.  
    6. Const WM_LBUTTONDOWN = &H201
    7. Const WM_LBUTTONUP = &H202
    8. Const WM_SETTEXT = &HC
    9.  
    10. Dim hExplorer&, hWorkerW&, hRebar&
    11. Dim hComboEx&, hCombo&, hEdit&, hGo&
    12.  
    13. hExplorer& = FindWindow("IEFrame", vbNullString)
    14. hWorkerW& = FindWindowEx(hExplorer&, 0&, "WorkerW", vbNullString)
    15. hRebar& = FindWindowEx(hWorkerW&, 0&, "ReBarWindow32", vbNullString)
    16. hComboEx& = FindWindowEx(hRebar&, 0&, "ComboBoxEx32", vbNullString)
    17. hCombo& = FindWindowEx(hComboEx&, 0&, "ComboBox", vbNullString)
    18. hEdit& = FindWindowEx(hCombo&, 0&, "Edit", vbNullString)
    19. hGo& = FindWindowEx(hComboEx&, 0&, "ToolbarWindow32", vbNullString)
    20.  
    21.  
    22. Call SendMessageByString(hEdit&, WM_SETTEXT, 0&, "www.vbforums.com")
    23. Call PostMessage(hGo&, WM_LBUTTONDOWN, 0, 0&)
    24. Call PostMessage(hGo&, WM_LBUTTONUP, 0, 0&)
    Last edited by ghettohacker; Dec 17th, 2005 at 02:35 AM. Reason: i forget alot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width