Dim frm As WinForm.Form = Forms.ActiveFormIf frm IsNot Nothing Then MessageBox.Show("活动窗口为:" & frm.Name)Else MessageBox.Show("无活动窗口!" )End If