|
-
April 5th, 2011, 12:50 PM
#16
Re: Wake monitor from sleep... updated method
 Originally Posted by Igor Vartanov
As far as I remember, it's something medical, your software. Did you think about alerting personal with audio message sent for example to bluetooth headset/speaker? Or sending text message to cellphone? Calling skype contact? These seem way more reliable in the situations when the personal may be not around, or the monitor is out of sight. 
That might be a good idea. Thanks. I'll run it by the client and see if they want it implemented. One question though, how do you send all those notifications? Is it via some web service?
-
April 5th, 2011, 01:00 PM
#17
Re: Wake monitor from sleep... updated method
Yeah, the customers... Well, AFAIK powering monitor down looks like stopping to produce video signal. So you might dig into video drivers, how they do the things.
Best regards,
Igor
-
April 5th, 2011, 01:09 PM
#18
Re: Wake monitor from sleep... updated method
The bluetooth part is the simplest one. Any headset looks just like another audio output device. All you need is to ask user to configure which device should be used for notification, otherwise the default device should be used. Then you just play audio with the device selected.
The text messages: Lots of mobile operator companies have web services for relaying text messages by plain http requests. Or have SMS gateways.
Calling skype via its API is quite well documented thing, just google about it.
Last edited by Igor Vartanov; April 7th, 2011 at 01:03 AM.
Best regards,
Igor
-
April 5th, 2011, 01:54 PM
#19
Re: Wake monitor from sleep... updated method
These are the 3 things I do to try and get the monitor/video out of a low-power state:
Code:
// 1st method
if (!SystemParametersInfo(SPI_SETLOWPOWERACTIVE, 0, 0, 0))
LogMessage(L"SystemParametersInfo(SPI_SETLOWPOWERACTIVE 0) failed, "
L"le = %u",
GetLastError());
// 2nd method
::SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, -1);
// 3rd method
if (!SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED |
ES_SYSTEM_REQUIRED))
LogMessage(L"SetThreadExecutionState failed, le = %u",
GetLastError());
// *** do something with screen ***
if (!SetThreadExecutionState(ES_CONTINUOUS))
LogMessage(L"SetThreadExecutionState failed, le = %u",
GetLastError());
I haven't used this code on anything higher than XP though. If your screen saver is active, then this code may need to be run within the screen saver's context for it to work.
gg
-
April 6th, 2011, 10:13 PM
#20
Re: Wake monitor from sleep... updated method
Thank you both. Very nice information.
Codeplug, I had some intense headache with HWND_BROADCAST under Vista/Windows 7. It seems that this method of broadcasting messages is very limited on those OS.
-
April 7th, 2011, 12:59 AM
#21
Re: Wake monitor from sleep... updated method
Of course, it's security enhance for Vista and Win7. No pay no gain!
-
April 13th, 2011, 02:30 AM
#22
Re: Wake monitor from sleep... updated method
 Originally Posted by ahmd
Thank you both. Very nice information.
Codeplug, I had some intense headache with HWND_BROADCAST under Vista/Windows 7. It seems that this method of broadcasting messages is very limited on those OS.
According to my sample HWND_BROADCAST is not mandatory. The whole thing seems about to make SC_MONITORPOWER reach DefWindowProc.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|