Private Declare Function IsWindowEnabled Lib "user32" (ByVal hwnd As Long) As Long Private Sub Command1_Click() If IsWindowEnabled(Text1) <> 0 Then'text1为句柄 Text2 = "已激活" Else Text2 = "未激活" End If End Sub