Welcome Guest.   Make a donation to an author on the site September 02, 2014, 06:52:07 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2014! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: logout when monitor turns on  (Read 2945 times)
agentsteal
Honorary Member
**
Posts: 75



View Profile Give some DonationCredits to this forum member
« on: April 10, 2010, 12:14:51 AM »

Hi,
Could someone make a program that will log out of Windows XP when my monitor is turned on? When I press the button to turn on my monitor, I want the computer to immediately log out before displaying anything.

Thanks!
Logged
SingingBoyo
Participant
*
Posts: 38

Java is awesome... C++ needs more libraries

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #1 on: April 10, 2010, 12:38:55 PM »

I may be wrong, but if I understand you right, then there's no way to do this.  XP logs out after screensavers by default, but I don't think you can tell whether the monitor has been turned on or off.
Logged

So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
Stoic Joker
Honorary Member
**
Posts: 5,218



View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: April 11, 2010, 10:56:26 AM »

(Forcing a logoff) Sounds like a great way to lose data - Why not just use Win + L to lock the session when leaving the computer?
Logged
skwire
Moderator
*****
Posts: 4,039



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: April 11, 2010, 07:05:54 PM »

Could someone make a program that will log out of Windows XP when my monitor is turned on? When I press the button to turn on my monitor, I want the computer to immediately log out before displaying anything.

I agree with SingingBoyo.  I don't think there is a way, programatically, to know when the user physically turns on a monitor.
Logged

ewemoa
Honorary Member
**
Posts: 2,415



View Profile Give some DonationCredits to this forum member
« Reply #4 on: April 11, 2010, 07:16:24 PM »

When I looked into this a bit, I got the sense it's doable in Vista and later.  Is that what other folks found too?
Logged
agentsteal
Honorary Member
**
Posts: 75



View Profile Give some DonationCredits to this forum member
« Reply #5 on: April 11, 2010, 08:01:56 PM »

I read that it can be done in XP with this:
http://msdn.microsoft.com.../dd694527%28VS.85%29.aspx

but I have no idea how to implement it...
Logged
SingingBoyo
Participant
*
Posts: 38

Java is awesome... C++ needs more libraries

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #6 on: April 11, 2010, 11:20:31 PM »

@agentsteal Looks to me like thats video devices, such as webcams and possibly video cameras.  Possibly USB devices in general, but I doubt it works for monitors.
Logged

So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
agentsteal
Honorary Member
**
Posts: 75



View Profile Give some DonationCredits to this forum member
« Reply #7 on: April 11, 2010, 11:25:29 PM »

I got that from here:
http://stackoverflow.com/...tate-in-windows-on-or-off
Logged
SingingBoyo
Participant
*
Posts: 38

Java is awesome... C++ needs more libraries

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #8 on: April 13, 2010, 01:38:23 PM »

And it still appears that its almost impossible to do it reliably.  It's almost definitely monitor-dependent, and I don't think its something you can do as a small, simple program.  However, Win+L works great, and if you really want to log off, log off properly! (As Stoic Joker said, forced logoffs are great for losing data.  Its sort of like holding down the power button because you can't wait for the computer to turn itself off.)
Logged

So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
agentsteal
Honorary Member
**
Posts: 75



View Profile Give some DonationCredits to this forum member
« Reply #9 on: April 13, 2010, 02:53:35 PM »

Quote
And it still appears that its almost impossible to do it reliably.  It's almost definitely monitor-dependent,
Could someone try making it anyway? I have multiple monitors I can try.

Quote
Win+L works great, and if you really want to log off, log off properly!
But I want to be able to keep the computer logged in to run a program after I leave but logged out when someone else wants to use it. Btw the computer can be forced to log off with the command "shutdown -l -f".
Logged
SingingBoyo
Participant
*
Posts: 38

Java is awesome... C++ needs more libraries

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #10 on: April 13, 2010, 10:29:16 PM »

Win+L is basically the equivalent of switch users, in hotkey form.  Your program should stay running.
Logged

So you came along and found Java(insert programming language here)? Randomly?  Well then, you're just like me! Java fiends rule.  (Though other languages do have their uses.)
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.034s | Server load: 0.15 ]