Determining If A Monitor Is Off: "AnswerDetermining If A Monitor Is Off
*
Wednesday, July 18, 2007 5:03 PMstack Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
I've found code that will turn a monitor on and off:
Code Snippet
#include
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// Eliminate user's interaction for 500 ms
Sleep(500);
// Turn off monitor
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
// Turn on monitor
// SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) -1);
// Low power monitor
// SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 1);
return 0;
}
Now I am looking for code that will tell me if a monitor is on or off. Anyone have any examples?
o ReplyReply
o QuoteQuote
Answers
*
Thursday, July 19, 2007 8:10 AMBruno van Dooren Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Answer
Sign In to Vote
0
Sign In to Vote
I don't know. Try asking in the appropriate platform SDK nntp newsgroup
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx
Even if you can query the monitor state, this won't tell you if the monitor itself is powered on.
At home I still use a 19' iyama crt. Windows doesn't know when I press the monitor power button.
Btw: have you tried google or www.codeproject.com ?
o ReplyReply
o QuoteQuote
All Replies
*
Thursday, July 19, 2007 8:10 AMBruno van Dooren Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Answer
Sign In to Vote
0
Sign In to Vote
I don't know. Try asking in the appropriate platform SDK nntp newsgroup
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx
Even if you can query the monitor state, this won't tell you if the monitor itself is powered on.
At home I still use a 19' iyama crt. Windows doesn't know when I press the monitor power button.
Btw: have you tried google or www.codeproject.com ?
o ReplyReply
o QuoteQuote
– Enviado usando a Barra de Ferramentas Google"
segunda-feira, 22 de novembro de 2010
Assinar:
Postar comentários (Atom)
Nenhum comentário:
Postar um comentário