473,395 Members | 1,670 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to Check if Monitor Is Powered Down in VISTA

Ed
I want to know when the screensaver has kicked in on my monitor so
that I can turn off the desk light in my office.

Under XP it has worked great. I use the following to check if
screensaver is running:

'' Check if Screen Saver is Running
i = WinApi.SystemParametersInfo(114, 0, SS, 0)
'SPI_GETSCREENSAVERRUNNING
However, under VISTA, apparently the screensaver is stopped when the
monitor is powered down due to inactivity. The above call returns
false when activity is present. Shows TRUE when the screensaver kicks
on, but returns to FALSE when the monitor powers off.

Therefore, I need to know when the monitor of powered ON/OFF also. No
problem, I just used:

i = WinApi.SystemParametersInfo(84, 0, PO, 0)
'SPI_GETPOWEROFFACTIVE

However, under VISTA, this always returns FALSE no matter what.

What little I've been able to find indicates that this function does
not work under VISTA.

Does anyone have any code that I can use under VISTA and VS2005 VB to
detect when the monitored has been powered down?

tenholde

Oct 22 '07 #1
0 1511

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: KJM | last post by:
How can I detect if the user has dual monitors and then how do I control which monitor a form is displayed on. Currently my forms always come up on my right monitor. What if I want to have it...
9
by: Jon LaBadie | last post by:
Suppose I'm using stdio calls to write to a disk file. One possible error condition is no space on file system or even (in unix environment) a ulimit of 0 bytes. Which calls would be expected to...
12
by: Perecli Manole | last post by:
I am having some strange thread synchronization problems that require me to better understand the intricacies of Monitor.Wait/Pulse. I have 3 threads. Thread 1 does a Monitor.Wait in a SyncLock...
2
by: Ian | last post by:
Monitor::Enter and Monitor::Exit must be called in pairs. Is there a way to determine if Monitor::Exit has been called so that it does not get called a second time? The psuedocode below...
4
by: =?Utf-8?B?a2F5a28yMDAw?= | last post by:
Hey folks, I'm having a bit of an issue with how Windows Vista (or my ASUS notebook) handles closing my notebook lid. If I have an external monitor (my TV through S-Video) connected to my...
2
by: =?Utf-8?B?YW5ub3llZCB3aXRoIHZpc3Rh?= | last post by:
I have a new Toshiba Satellite laptop. It came with Vista and IE 7. When I close an Exporer window (using the X in the corner) I get a message that says "Internet Explorer has stopped working and...
13
by: Cross | last post by:
I am developing an application that will show movies. When you wach a movie, you do not want the Power Option "Turn off monitor" to be anabled. Is there anyway to fix this from VB.net? (note that I...
2
by: =?Utf-8?B?R2xlbm4=?= | last post by:
i just upgraded from XP to Vista and so far am kicking myself for it. After I installed and got all my drivers updated i went to shut down windows and it will not shut down. It closes all programs...
2
by: Feresca | last post by:
Hi all, I am making a program that requires the user to be able to shut down windows after a set period of time.The code I used is as follows: namespace Program_1 { public partial class...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.