您的位置首页生活百科

VB检测名称为"QQ123"的窗口是否存在

VB检测名称为"QQ123"的窗口是否存在

的有关信息介绍如下:

VB检测名称为

要用到API函数:Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long'一行 Private Sub Command1_Click() Dim hwd As Long hwd = FindWindow(vbNullString, "QQ2011") If hwd <> 0 Then MsgBox "目标窗口已找到", 64, "提示" Else MsgBox "未找到目标窗口", 64, "提示" End If End Sub