Home > Software engineering >  VB how to obtain a software of Internet Explorer_Server handle
VB how to obtain a software of Internet Explorer_Server handle

Time:10-11

I've tried using FindWindowEx access but not, like Enumchilewindows and Getwindowsclass can find out his handle
Master can help give me a good example!

CodePudding user response:

This is what to do with?

CodePudding user response:

Do this thing in the right way, you suggest that you know about the BHO technology, you can baidu "vb BHO."

CodePudding user response:

The use FindWindowEx should be able to, all with FindWindowEx (HWND, HWND1 VBNULLSTRING, VBNULLSTRING)
Sometimes you specify CLASS also not line, but all with NULL line, then you get all the HWND, get the CLASS, the comparison

CodePudding user response:

I just use this approach to
 '┏ 〓 〓 〓 〓 〓 〓 〓 〓 〓 FindHwndByClassAndId, start 〓 〓 〓 〓 〓 〓 〓 〓 〓 ┓ 
'[abstract] :
'search form multi-level down the handle to a few of the same class
The Function FindHwndByClassAndId (WinHwnd As Long, ByVal Class As a String, Optional FindId As an Integer, Optional Id As an Integer) As Long
'[mycode_id: 1934], edittime: 2011/8/3 3:30:07
Dim Hwnd2 As Long
Dim FindHwnd As Long, TempFindHwnd As Long
Hwnd2=GetWindow (WinHwnd GW_CHILD)
While FindHwnd=0 And Hwnd2 & gt; 0
If GetClass (Hwnd2)=Class Then
TempFindHwnd=Hwnd2

If Id=FindId Then
FindHwnd=TempFindHwnd
GoTo DoEnd
The Else
Id=Id + 1
End the If
End the If

FindHwnd=FindHwndByClassAndId (FindId Hwnd2, Class, Id)
Hwnd2=GetWindow (Hwnd2 GW_HWNDNEXT)
Wend
DoEnd:
FindHwndByClassAndId=FindHwnd

End the Function
'┗ 〓 〓 〓 〓 〓 〓 〓 〓 〓 FindHwndByClassAndId, end 〓 〓 〓 〓 〓 〓 〓 〓 〓 ┛

CodePudding user response:

According to the name of the class to find Internet Explorer_Server

CodePudding user response:

The
reference 4 floor xiaoyao961 reply:
I is to use this approach to
 '┏ 〓 〓 〓 〓 〓 〓 〓 〓 〓 FindHwndByClassAndId, start 〓 〓 〓 〓 〓 〓 〓 〓 〓 ┓ 
'[abstract] :
'search form multi-level down the handle to a few of the same class
The Function FindHwndByClassAndId (WinHwnd As Long, ByVal Class As a String, Optional FindId As an Integer, Optional Id As an Integer) As Long
'[mycode_id: 1934], edittime: 2011/8/3 3:30:07
Dim Hwnd2 As Long
Dim FindHwnd As Long, TempFindHwnd As Long
Hwnd2=GetWindow (WinHwnd GW_CHILD)
While FindHwnd=0 And Hwnd2 & gt; 0
If GetClass (Hwnd2)=Class Then
TempFindHwnd=Hwnd2

If Id=FindId Then
FindHwnd=TempFindHwnd
GoTo DoEnd
The Else
Id=Id + 1
End the If
End the If

FindHwnd=FindHwndByClassAndId (FindId Hwnd2, Class, Id)
Hwnd2=GetWindow (Hwnd2 GW_HWNDNEXT)
Wend
DoEnd:
FindHwndByClassAndId=FindHwnd

End the Function
'┗ 〓 〓 〓 〓 〓 〓 〓 〓 〓 FindHwndByClassAndId, end 〓 〓 〓 〓 〓 〓 〓 〓 〓 ┛
I get several child window handle to the child window handle to access the Internet Explorer_Server, is I don't know how to make the Internet Explorer_Server redirect the other website

CodePudding user response:

refer to 6th floor Tea_123 response:
Quote: refer to 4th floor xiaoyao961 response:

I just use this approach to
 '┏ 〓 〓 〓 〓 〓 〓 〓 〓 〓 FindHwndByClassAndId, start 〓 〓 〓 〓 〓 〓 〓 〓 〓 ┓ 
'[abstract] :
'search form multi-level down the handle to a few of the same class
The Function FindHwndByClassAndId (WinHwnd As Long, ByVal Class As a String, Optional FindId As an Integer, Optional Id As an Integer) As Long
'[mycode_id: 1934], edittime: 2011/8/3 3:30:07
Dim Hwnd2 As Long
Dim FindHwnd As Long, TempFindHwnd As Long
Hwnd2=GetWindow (WinHwnd GW_CHILD)
While FindHwnd=0 And Hwnd2 & gt; 0
If GetClass (Hwnd2)=Class Then
TempFindHwnd=Hwnd2

If Id=FindId Then
FindHwnd=TempFindHwnd
GoTo DoEnd
The Else
Id=Id + 1
End the If
End the If

FindHwnd=FindHwndByClassAndId (FindId Hwnd2, Class, Id)
Hwnd2=GetWindow (Hwnd2 GW_HWNDNEXT)
Wend
DoEnd:
FindHwndByClassAndId=FindHwnd

End the Function
'┗ 〓 〓 〓 〓 〓 〓 〓 〓 〓 FindHwndByClassAndId, end 〓 〓 〓 〓 〓 〓 〓 〓 〓 ┛
I get several child window handle to the child window handle to access the Internet Explorer_Server, is I don't know how to make the Internet Explorer_Server redirect the other website
not according to the handle,

CodePudding user response:

http://bbs.csdn.net/topics/390540874? Page=1 # post - 395251637

Give points!

CodePudding user response:

refer to the eighth floor sysdzw response:
http://bbs.csdn.net/topics/390540874? Page=1 # post - 395251637

Give points


Another contribution before using my method of clsWindows framework, is very simple:
 Dim w As New clsWindow 
If w.G etWindowHwndByTitleEx (" application title bar text ") & gt; 0 Then
MsgBox w.G etElementHwndByClassName (" Internet Explorer_Server ") 'get ie control handle
End the If

CodePudding user response:

With the desert plug-in EnumWindow
Cstrings cc=dm. EnumWindow (0, _T (" "), _T (" Internet Explorer_Server "), 2 + 16);
Convert the cc to int, the int is the handle
  •  Tags:  
  • API
  • Related