topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 3, 2024, 4:57 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: logout when monitor turns on  (Read 8178 times)

agentsteal

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 75
    • View Profile
    • Donate to Member
IDEA: logout when monitor turns on
« on: April 10, 2010, 12:14 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!

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #1 on: April 10, 2010, 12:38 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.
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
  • Joined in 2008
  • **
  • Posts: 6,649
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #2 on: April 11, 2010, 10:56 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?

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #3 on: April 11, 2010, 07:05 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.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #4 on: April 11, 2010, 07:16 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?

agentsteal

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 75
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #5 on: April 11, 2010, 08:01 PM »
I read that it can be done in XP with this:
http://msdn.microsof...4527%28VS.85%29.aspx

but I have no idea how to implement it...

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #6 on: April 11, 2010, 11:20 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.
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
  • Joined in 2007
  • **
  • Posts: 75
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #7 on: April 11, 2010, 11:25 PM »

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #8 on: April 13, 2010, 01:38 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.)
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
  • Joined in 2007
  • **
  • Posts: 75
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #9 on: April 13, 2010, 02:53 PM »
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.

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".

SingingBoyo

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 38
  • Java is awesome... C++ needs more libraries
    • View Profile
    • Donate to Member
Re: IDEA: logout when monitor turns on
« Reply #10 on: April 13, 2010, 10:29 PM »
Win+L is basically the equivalent of switch users, in hotkey form.  Your program should stay running.
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.)