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.
Printable View
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.
What exactly do you mean by manipulate? Enter a URL and make it go there? Could you explain a bit more?
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?
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?
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&)