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?
Printable View
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.
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.
These are the 3 things I do to try and get the monitor/video out of a low-power state:
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.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());
gg
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.
Of course, it's security enhance for Vista and Win7. No pay no gain! :)