Code:
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
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
Code:
cmdDisable_Click()
Static bDisabled As Boolean, find_it As Long
bDisabled = Not bDisabled
find_it = FindWindowEx(0&, 0&, "Shell_TrayWnd", vbNullString)
Call EnableWindow(FindWindowEx(find_it, 0&, "Button", vbNullString), Not bDisabled)
End Sub
Code:
cmdEnable_Click()
Static bDisabled As Boolean, find_it As Long
bDisabled = Not bDisabled
find_it = FindWindowEx(0&, 0&, "Shell_TrayWnd", vbNullString)
Call EnableWindow(FindWindowEx(find_it, 0&, "Button", vbNullString), bDisabled)
End Sub