Originally posted by Eras3r
VB Code:
  1. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  2. 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
  3. Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
  4.  
  5. Private Sub Form_Load()
  6.     ShellTrayWnd = FindWindow("Shell_TrayWnd", vbNullString)
  7.     Button = FindWindowEx(ShellTrayWnd, 0, "Button", vbNullString)
  8.     EnableWindow Button, False
  9. End Sub

This works on WinNT 4.0 ..... The window classes may be different on later versions.
This disables only the clicking, not the keyboard (Win key).