I want to disable start button and alt+tab button using vb.net. Can any one help me. I tried with below coding but not success
Option Explicit
Private Declare Function EnableWindow Lib "user32" _
(ByVal hwnd As Long, ByVal fEnable As Long) As Long
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindow A" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindow ExA" (ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Sub StartButton(bln Value As Boolean)
Dim lngHandle As Long
Dim lngStartButton As Long
lngHandle = FindWindow("She ll_TrayWnd", "")
lngStartButton = FindWindowEx(ln gHandle, 0, "Button", vbNullString)
If blnValue Then
EnableWindow lngStartButton, 1
Else
EnableWindow lngStartButton, 0
End If
End Sub
Private Sub Command1_Click( )
StartButton True
End Sub
Private Sub Command2_Click( )
StartButton False
End Sub
Option Explicit
Private Declare Function EnableWindow Lib "user32" _
(ByVal hwnd As Long, ByVal fEnable As Long) As Long
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindow A" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" _
Alias "FindWindow ExA" (ByVal hWnd1 As Long, _
ByVal hWnd2 As Long, _
ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Sub StartButton(bln Value As Boolean)
Dim lngHandle As Long
Dim lngStartButton As Long
lngHandle = FindWindow("She ll_TrayWnd", "")
lngStartButton = FindWindowEx(ln gHandle, 0, "Button", vbNullString)
If blnValue Then
EnableWindow lngStartButton, 1
Else
EnableWindow lngStartButton, 0
End If
End Sub
Private Sub Command1_Click( )
StartButton True
End Sub
Private Sub Command2_Click( )
StartButton False
End Sub