|
-
Dec 10th, 2005, 11:28 PM
#1
Thread Starter
Addicted Member
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.
-
Dec 13th, 2005, 04:22 PM
#2
-
Dec 13th, 2005, 06:48 PM
#3
Lively Member
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?
-
Dec 16th, 2005, 09:47 PM
#4
Thread Starter
Addicted Member
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?
-
Dec 17th, 2005, 02:00 AM
#5
Lively Member
Re: Need to handle textbox and "Go" button of I.E.
try this.
VB Code:
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
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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
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
Const WM_LBUTTONDOWN = &H201
Const WM_LBUTTONUP = &H202
Const WM_SETTEXT = &HC
Dim hExplorer&, hWorkerW&, hRebar&
Dim hComboEx&, hCombo&, hEdit&, hGo&
hExplorer& = FindWindow("IEFrame", vbNullString)
hWorkerW& = FindWindowEx(hExplorer&, 0&, "WorkerW", vbNullString)
hRebar& = FindWindowEx(hWorkerW&, 0&, "ReBarWindow32", vbNullString)
hComboEx& = FindWindowEx(hRebar&, 0&, "ComboBoxEx32", vbNullString)
hCombo& = FindWindowEx(hComboEx&, 0&, "ComboBox", vbNullString)
hEdit& = FindWindowEx(hCombo&, 0&, "Edit", vbNullString)
hGo& = FindWindowEx(hComboEx&, 0&, "ToolbarWindow32", vbNullString)
Call SendMessageByString(hEdit&, WM_SETTEXT, 0&, "www.vbforums.com")
Call PostMessage(hGo&, WM_LBUTTONDOWN, 0, 0&)
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|