Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Sub Timer1_Timer()
Dim wnd As Long
Dim s As String
wnd = GetForegroundWindow()
s = "当前活动窗口句柄:" + Str(wnd) + " Hex:" + Hex(wnd)
Text1.Text = s
End Sub
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Sub Timer1_Timer() Dim wnd As Long Dim s As String wnd = GetForegroundWindow() s = "当前活动窗口句柄:" + Str(wnd) + "Hex:" + Hex(wnd) Text1.Text = s
End Sub