VB中FindWindow()函数的用法OptionExplicitPrivateDeclareFu
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Sub Timer1_Timer()
Cls
Dim Title As String * 256
Dim Titlelen As Long
Dim Resule As Long
Resule = FindWindow(vbNullString, vbNullString)
Titlelen = 255
GetWindowText Resule, Title, Titlelen
Print Title
End Sub