怎么能把开始按钮变的不可用了!!!  按windows键不起作用,谢谢

解决方案 »

  1.   

    禁用按钮是简单的,但是禁止win键就有点麻烦了Option Explicit
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As LongPrivate Sub Command1_Click()
        EnableStartButton False
    End SubPrivate Sub Command2_Click()
        EnableStartButton True
    End SubSub EnableStartButton(ByVal fEnable As Boolean)
        Dim hShell_TrayWnd As Long
        Dim hButtonWnd As Long
        hShell_TrayWnd = FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString)
        If hShell_TrayWnd <> 0 Then
            hButtonWnd = FindWindowEx(hShell_TrayWnd, 0, "BUTTON", "开始")
            If hButtonWnd <> 0 Then
                EnableWindow hButtonWnd, fEnable * -1
            End If
        End If
    End Sub
      

  2.   

    我的键盘上没有win键,但可以按Crtl+Esc键弹出开始菜单,楼上的代码不能阻击这两个键的组合,有什么办法可以阻击这两个键弹出开始菜单吗?谢谢。
      

  3.   

    http://blog.joycode.com/jiangsheng/archive/2004/07/20/27909.aspx
      

  4.   

    直接FindWindowEx来查找开始窗口