TO:yinweihong(真名:尹伟红)
我是这样写的
Private Declare Function GetParent Lib "user32" Alias "GetParent" (ByVal hwnd As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Long
dim fh as long
dim ph as long
private sub timer1_timer()
fh=GetForegroundWindow
ph=GetParent(fh)
text1.text=ph
end sub