vb.net问题,如何根据句柄获取ihtmldocument2接口,网上都是c或者c#,希望学习大侠代码,谢谢
展开全部
我这有vb.net的,知道句柄就可获取,用C#改了好久才可以。
Declare Function ObjectFromLresult Lib "oleacc" (ByVal lResult As Int32, ByRef riid As System.Guid, ByVal wParam As Int32, ByRef ppvObject As mshtml.IHTMLDocument) As Int32
Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Int32
Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" (ByVal hWnd As Int32, ByVal msg As Int32, ByVal wParam As Int32, ByVal lParam As Int32, ByVal fuFlags As Int32, ByVal uTimeout As Int32, ByRef lpdwResult As Int32) As Int32
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
Const SMTO_ABORTIFHUNG = &H2
用这些api可实现,你没给分,我也舍不得拿出代码,费了很多时间才搞定的代码
Declare Function ObjectFromLresult Lib "oleacc" (ByVal lResult As Int32, ByRef riid As System.Guid, ByVal wParam As Int32, ByRef ppvObject As mshtml.IHTMLDocument) As Int32
Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Int32
Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" (ByVal hWnd As Int32, ByVal msg As Int32, ByVal wParam As Int32, ByVal lParam As Int32, ByVal fuFlags As Int32, ByVal uTimeout As Int32, ByRef lpdwResult As Int32) As Int32
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
Const SMTO_ABORTIFHUNG = &H2
用这些api可实现,你没给分,我也舍不得拿出代码,费了很多时间才搞定的代码
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询