Home > Software engineering >  Chrome unable to get the address bar
Chrome unable to get the address bar

Time:10-04


This code still can obtain the browser address in 2012, but now not available, use spy to see the next and previous, what reason be?
Option Explicit

Private Const WM_GETTEXT=& amp; HD
Private Const WM_GETTEXTLENGTH=& amp; HE

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal HWND As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetDesktopWindow Lib "user32 () As" Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private 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

Private Sub Command1_Click ()
Dim dhWnd As Long
Dim chWnd As Long

Dim Web_Caption As String * 256
Dim Web_hWnd As Long

Dim the URL As a String * 256
Dim URL_hWnd As Long

DhWnd=GetDesktopWindow
ChWnd=FindWindowEx (dhWnd, 0, "Chrome_WidgetWin_1 vbNullString)
Web_hWnd=FindWindowEx (dhWnd chWnd, "Chrome_WidgetWin_1 vbNullString)
URL_hWnd=FindWindowEx (Web_hWnd, 0, "Chrome_OmniboxView vbNullString)

Call SendMessage (Web_hWnd, WM_GETTEXT, 256, ByVal Web_Caption)
Call SendMessage (URL_hWnd, WM_GETTEXT, 256, ByVal URL)

MsgBox Split (Web_Caption, CRH (0)) (0) & amp; VbCrLf & amp; The Split (URL, CRH (0)) (0)

End Sub

CodePudding user response:

Their top ohoo

CodePudding user response:

reference 1st floor ssss7117 response:
his top agghh

Problem solved?

CodePudding user response:

As an administrator to run
In XP compatibility mode
?
  • Related