PC Review


Reply
Thread Tools Rate Thread

Turn off Monitor

 
 
Herbert Seidenberg
Guest
Posts: n/a
 
      5th May 2005
Can the monitor be turned on and off depending on the value of
real-time data inputted at COM1 and processed by Excel?

 
Reply With Quote
 
 
 
 
Harlan Grove
Guest
Posts: n/a
 
      6th May 2005
"Herbert Seidenberg" <herbds7-(E-Mail Removed)> wrote...
>Can the monitor be turned on and off depending on the value of
>real-time data inputted at COM1 and processed by Excel?


I can't comment about the data feed from COM1 into Excel, but once Excel
processes it, Excel could run the blank screen saver, which would appear as
if it turned off the monitor. There may be API calls to switch the monitor
to power saver mode.


 
Reply With Quote
 
Harald Staff
Guest
Posts: n/a
 
      6th May 2005
"Harlan Grove" <(E-Mail Removed)> skrev i melding
news:%(E-Mail Removed)...
> There may be API calls to switch the monitor
> to power saver mode.


There is a first time for everything. Today I can not only confirm, but even
provide detail to, a post by Harlan.

Option Explicit

Const SC_MONITORPOWER = &HF170&
Const WM_SYSCOMMAND = &H112&
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

Sub Stby()
'Standby monitor:
Dim x As Long
x = SendMessage(Application.hWnd, _
WM_SYSCOMMAND, SC_MONITORPOWER And 65520, 1&)
End Sub

Sub Onagain()
'Turn on monitor:
Dim x As Long
x = SendMessage(Application.hWnd, _
WM_SYSCOMMAND, SC_MONITORPOWER And 65520, -1&)
End Sub

Sub Test()
Call Stby
'Application.OnTime (Now + TimeSerial(0, 0, 10)), "Onagain"
End Sub

Best wishes Harald


 
Reply With Quote
 
Herbert Seidenberg
Guest
Posts: n/a
 
      7th May 2005
Thanks, that worked perfectly.
This is going to extend the battery life of my mobile application a lot.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Turn off monitor" feature doesn't turn off monitor stevehuff@usa.net Windows XP Customization 3 22nd Feb 2007 08:05 PM
power options "turn off monitor" - monitor keeps coming back on Richy Windows XP General 2 2nd Mar 2006 12:05 PM
Screensavers won't turn on nor will automatic monitor turn off =?Utf-8?B?TmVlZCBoZWxwIHNvb24=?= Windows XP Help 1 24th Feb 2004 10:13 AM
screen saver vs turn off monitor setting for LCD monitor dave Computer Hardware 4 7th Dec 2003 09:23 PM
Re: Monitor does'nt turn on Dakai Windows XP New Users 1 13th Jul 2003 10:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:32 AM.