VB 知道句柄类名和窗口名称。如何获取他的句柄呢
2个回答
展开全部
比如查找记事本是否打开了
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Dim NotepadHwnd As Long
NotepadHwnd = FindWindow("notepad", vbNullString)
MsgBox NotepadHwnd
End Sub
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Dim NotepadHwnd As Long
NotepadHwnd = FindWindow("notepad", vbNullString)
MsgBox NotepadHwnd
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询