Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Private Sub Command1_Click() '锁定(hwnd为指定窗口的句柄)
EnableWindow hwnd, 0
End Sub
Private Sub Command2_Click() '解除锁定(hwnd为指定窗口的句柄)
EnableWindow hwnd, 1
End Sub