如何在PB中得到窗体的句柄
1个回答
展开全部
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Function FindWnd(ByVal wName As String) As Long
If Val(Application.Version) < 9 Then
FindWnd = FindWindow("ThunderXFrame", wName) 'XL97
Else
FindWnd = FindWindow("ThunderDFrame", wName) 'XL2000
End If
If FindWnd = 0 Then FindWnd = FindWindow(vbNullString, wName)
End Function
调用:句柄=FindWnd("窗口标题")
Function FindWnd(ByVal wName As String) As Long
If Val(Application.Version) < 9 Then
FindWnd = FindWindow("ThunderXFrame", wName) 'XL97
Else
FindWnd = FindWindow("ThunderDFrame", wName) 'XL2000
End If
If FindWnd = 0 Then FindWnd = FindWindow(vbNullString, wName)
End Function
调用:句柄=FindWnd("窗口标题")
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询