Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long

解决方案 »

  1.   

    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
      

  2.   


    需要API:GetForegroundWindow   EnableWindow
    执行代码:
    EnableWindow( GetForegroundWindow(),0)
      

  3.   

    GetForegroundWindow   EnableWindow