Private Declare Function GetActiveWindow Lib "user32" () As Long Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long Private Sub Command1_Click() Dim S As Long Dim TReturn As Long S = GetActiveWindow TReturn = EnableWindow(S, 0) End Sub
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Private Sub Command1_Click()
Dim S As Long
Dim TReturn As Long
S = GetActiveWindow
TReturn = EnableWindow(S, 0)
End Sub
需要API:GetForegroundWindow EnableWindow
执行代码:
EnableWindow( GetForegroundWindow(),0)