-1
在我的應用程序中需要找到WebBrowser
引發的對話框。我嘗試這樣做:如何在控件內部找到句柄?
FindWindowEx(webBrowserEx1.Handle, IntPtr.Zero, "#32770", "title here")
但它並返回IntPtr.Zero
它正常工作:
FindWindow("#32770", "title here")
但我想搜索裏面webBrowserEx1
控制,而不是像一個全球性的搜索窗口FindWindow()
更新:使用spy ++我可以看到DialogBox的DialogBox的第一個子窗口和所有者都不是WebBrowser
(我猜這就是爲什麼它不起作用),但父窗口是我自己的應用程序(WebBrowser託管在其中),所以我更新了我的代碼這個:
handle = FindWindowEx(this.Handle, IntPtr.Zero, "#32770", "title here");
但它沒有奏效。
我現在正在使用(和學習使用)間諜。這很好(我正在使用AutoIt信息工具)。在Spy ++的Property Inspector中的Window選項卡它對兩者都表示「none」:第一個子窗口和所有者窗口...因此DialogBox並不是真正由WebBrowser創建的,對吧?如果是這樣,誰來做?爲什麼所有者窗口甚至不是我的應用程序的窗口(WebBrowser託管在哪裏)? – Jack
請查看更新 – Jack