|
Заблокировать кнопку ПУСК |
|
|
Private Declare Function FindWindow Lib "user32" Alias
"FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal
fEnable As Long) As Long
Public Sub EnableStartButton(Optional Enabled As Boolean = True)
'this will enable/disable any window with a little modifaction
Dim lHwnd As Long
'найти hWnd
lHwnd& = FindWindowEx(FindWindow("Shell_TrayWnd", ""), 0&,
"Button", vbNullString)
'call the enablewindow api and do the what needs to be done
Call EnableWindow(lHwnd&, CLng(Enabled))
End Sub
Private Sub Form_Load()
EnableStartButton True 'Кнопка ПУСК не заблокирована
'EnableStartButton False 'Кнопка ПУСК заблокирована
End Sub
|
|
|
|
|
|
|