Hello, anyone know a way to put the monitor into standby mode? MSDN seems to say "video and miniport driver (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/graphics/hh/graphics/VideoMiniport_Functions_22a6c5ae-0c31-48a6-8882-06edfea32c1a.xml.asp)". Is there nothing easier? Thanks.
Mark,
I don't know if this is exactly what you want, but you can do this:
.486
.model flat, stdcall
option casemap:none
include c:\masm32\include\windows.inc
include c:\masm32\include\kernel32.inc
include c:\masm32\include\user32.inc
includelib c:\masm32\lib\kernel32.lib
includelib c:\masm32\lib\user32.lib
MONITOR_ON EQU -1
MONITOR_LOW_POWER EQU 1
MONITOR_OFF EQU 2
.data
hWnd DWORD 0
.code
start:
invoke GetForegroundWindow
mov hWnd, eax
invoke SendMessage, hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF
invoke Sleep, 4000
invoke SendMessage, hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_ON
invoke ExitProcess, 0
end start
end
Aaaaha! Yes Greg, that does exactly what I want. :) Now I can quit powering off my monitor when it should be sleeping instead. :bg
(I miss the old Win9x screensaver where you can park the mouse pointer in the top-right to force monitor standby...) now I can just do the same thing with an accelerator key toggle. Thanks! :U I'll post a usable app once I get it completed.
Throw away code.. :toothy
[attachment deleted by admin]
Thanks Tedd :U
Small correction.. :red
;;- WM_DESTROY --------------------------------------------------------------------------------------
.ELSEIF (eax==WM_DESTROY)
invoke Shell_NotifyIcon,NIM_DELETE,ADDR iconData
invoke PostQuitMessage, NULL
How does one find these messages? Are they all documented somewhere? I know many messages are in Win32.hlp, but it doesn't even have WM_SYSCOMMAND in there. Can you point me in the right direction?
Thanks :bg
WM_SYSCOMMAND is in my win32.hlp :eek
Either I have a strange version, or you do :bdg
Alternatively, there's always: http://msdn.microsoft.com/library
Quote from: Tedd on June 14, 2005, 10:29:52 AM
WM_SYSCOMMAND is in my win32.hlp :eek
Either I have a strange version, or you do :bdg
:eek.. And I thought I had a good version of Win32.hlp :'(