rimembranze di vb6:
ho preso una funzione che fà quello che chiedi, scritta in vb.net, dal sito di msdn social e l'ho trasformata in vb6...
purtroppo non ho possibilità di provarla perchè qui ho montato Windows 2k e mi è impossibile installare Chrome.
Il mio pc a casa si rifiuta categoricamente di eseguire programmi scritti con linguaggi dell'anteguerra...
provalo, in caso di problemi chiedi.
devi solo passare l'handle della finestra alla funzione. (mi pare che tu ce l'abbia già)
codice:Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As Long Declare Function FindWindowEx Lib "User32" (parentHandle As Integer, childAfter As Integer, className As String, windowTitle As String) As Integer Private Const WM_GETTEXTLENGTH As Integer = &HE Private Const WM_GETTEXT As Integer = &HD Public Function getChromeUrl(winHandle As Integer) As String Const nChars As Integer = 256 Dim browserUrl As String Dim urlHandle As Integer Dim b As String Dim length As Integer browserUrl = "" length = SendMessage(urlHandle, WM_GETTEXTLENGTH, 0, 0) urlHandle = FindWindowEx(winHandle, 0, "Chrome_AutocompleteEditView", "") If length > 0 Then b = String(nChars, " ") SendMessage urlHandle, WM_GETTEXT, nChars, b browserUrl = b End If getChromeUrl = browserUrl End Function

Rispondi quotando