掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
InternetExplorerのURLを取得したい (ID:65213)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
.NETです InternetExplorerで表示中のURLを取得したいので、 アドレス欄のエディット内から取得しようとしています。 しかし、EnumChildWindowsで子ウィンドウから探しても見つからないのです ハンドルからGetWindowTextによって取得しようとしてるのが悪いのでしょうか? EnumWindows(w_Delegate, 0) EnumChildWindows(windowhandle, c_Delegate, Nothing) 'トップレベルウィンドウのコールバック Public Function EnumWindowsProc(ByVal hwnd As Integer, ByVal lParam As Integer) As Integer Dim str As String str = Space(8) GetClassName(hwnd, str, Len(str)) str = Mid(str, 1, InStr(1, str, vbNullChar) - 1) If str = "IEFrame" Then windowhandle = hwnd Return False Else Return True End If End Function '子ウィンドウのコールバック Public Function EnumChildProc(ByVal hwnd As Integer, ByVal lParam As Integer) As Integer Dim str As String Dim url As String str = Space(64) GetWindowText(hwnd, str, Len(str)) url = str str = Mid(str, 1, 4) If str = "http" Then geturl = url Return False Else Return True End If End Function UWSC(自動化ソフト兼微プログラミング言語)で、EDITを全取得してみたらできました
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.