hwnd=GetDesktopWindow();
SendMessage (hwnd,WM_SYSCOMMAND,SC_MONITORPOWER,0)
Sleep 30000
SendMessage (hwnd,WM_SYSCOMMAND,SC_MONITORPOWER,-1)
Amed писал(а):Декларации - самостоятельно (;
Код не проверял, нашёл за 10 сек в яндексе
- Код: Выделить всё
hwnd=GetDesktopWindow();
SendMessage (hwnd,WM_SYSCOMMAND,SC_MONITORPOWER,0)
Sleep 30000
SendMessage (hwnd,WM_SYSCOMMAND,SC_MONITORPOWER,-1)
Private Declare Sub Sleеp Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MONITORPOWER = &HF170&
Private Sub Form_Load()
Dim hwnd As Long
hwnd = GetDesktopWindow()
Call SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 0)
Sleep 30000
Call SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, -1)
End Sub
Sleep 30000
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Amed писал(а):
- Код: Выделить всё
Private Declare Sub Sleеp Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MONITORPOWER = &HF170&
Private Sub Form_Load()
Dim hwnd As Long
hwnd = GetDesktopWindow()
Call SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 0)
Sleep 30000
Call SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, -1)
End Sub
rivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
rivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
A.A.Z. писал(а):Патамушта ByRef lParam As Any Поменяйна
- Код: Выделить всё
rivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
- Код: Выделить всё
rivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Сейчас этот форум просматривают: Google-бот и гости: 78