| !!
魔界の仮面弁士 様
このような未熟者にここまで親切にして頂いて何てお礼を申せばよいやら・・・ あれから何とかならないかと試行錯誤致しまして、TabThumbnailWindowではなくて IEFRAMEを取得出来ました。 しかし、VBAではInternet Explorer_Serverまで辿り付いたのですが VB.NETで子ウィンドウを列挙することが出来ません。 何卒、ご教授のほど宜しくお願いいたします。
又、■90511で教わった件は順次取り組んでまいります。
コードは下記の通りです。
Public Function EnumWindowCallBack(hWnd As IntPtr, lparam As IntPtr) As Boolean
Dim textLen As Integer = GetWindowTextLength(hWnd) Dim tsb As New StringBuilder(textLen + 1) Dim csb As New StringBuilder(256)
If 0 < textLen Then GetWindowText(hWnd, tsb, tsb.Capacity) GetClassName(hWnd, csb, csb.Capacity)
If tsb.ToString() = "JavaScript テスト - Internet Explorer" Then If csb.ToString() = "IEFrame" Then Debug.WriteLine(tsb.ToString()) Debug.WriteLine(csb.ToString()) Debug.WriteLine(hWnd) hWnd_IEFRAME = hWnd
EnumChildWindows(hWnd_IEFRAME, AddressOf EnumChildWindowsProc, IntPtr.Zero) ’IEFrame下のInternet Explorer_Serverを取得したいがここでエラーになります。
■エラー内容 BC31143 メソッド 'Public Function EnumChildWindowsProc(hWnd As IntPtr, lparam As IntPtr) As IntPtr' に、デリゲート 'Delegate Function API.EnumChildProc(hWnd As IntPtr, ByRef lParam As IntPtr) As Boolean' と互換性があるシグネチャがありません。
End If End If
End If
Return True End Function
Public Function EnumChildWindowsProc(hWnd As IntPtr, lparam As IntPtr) As Integer
Dim textLen As Integer = GetWindowTextLength(hWnd) Dim tsb As New StringBuilder(textLen + 1) Dim csb As New StringBuilder(256)
' クラス名取得 GetClassName(hWnd, csb, csb.Capacity)
Debug.WriteLine(csb.ToString())
' リターン EnumChildWindowsProc = 1 End Function
<DllImport("user32")> Function EnumChildWindows( <[In]()> ByVal hWndParent As IntPtr, <[In]()> ByVal lpEnumFunc As EnumChildProc, <[In]()> ByRef lParam As IntPtr ) As Boolean End Function
|