读书人

怎么获取windows界面的句柄

发布时间: 2012-01-19 20:57:58 作者: rapoo

如何获取windows界面的句柄
如题,谢谢。

[解决办法]
API:
<DllImport( "user32.dll ", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FindWindow( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As IntPtr
End Function

<DllImport( "user32.dll ", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FindWindow( _
ByVal lpClassName As IntPtr, _
ByVal lpWindowName As IntPtr) As IntPtr
End Function

<DllImport( "user32.dll ", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FindWindow( _
ByVal lpClassName As IntPtr, _
ByVal lpWindowName As String) As IntPtr
End Function

<DllImport( "user32.dll ", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FindWindow( _
ByVal lpClassName As String, _
ByVal lpWindowName As IntPtr) As IntPtr
End Function

<DllImport( "user32.dll ", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FindWindowEx( _
ByVal hWnd As IntPtr, _
ByVal hWndChild As IntPtr, _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As IntPtr
End Function

<DllImport( "user32.dll ", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FindWindowEx( _
ByVal hWnd As IntPtr, _
ByVal hWndChild As IntPtr, _
ByVal lpClassName As IntPtr, _
ByVal lpWindowName As IntPtr) As IntPtr
End Function

<DllImport( "user32.dll ", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FindWindowEx( _
ByVal hWnd As IntPtr, _
ByVal hWndChild As IntPtr, _
ByVal lpClassName As String, _
ByVal lpWindowName As IntPtr) As IntPtr
End Function

<DllImport( "user32.dll ", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FindWindowEx( _
ByVal hWnd As IntPtr, _
ByVal hWndChild As IntPtr, _
ByVal lpClassName As IntPtr, _
ByVal lpWindowName As String) As IntPtr
End Function

读书人网 >VB Dotnet

热点推荐