Am I logged on? - REXX
This is a discussion on Am I logged on? - REXX ; In a scheduled task, I'd like to be able to determine if my Windows
userid (Steve) is actually logged on. By "logged on", I mean having an
active display, and not in screensaver mode. Since my system activates
the screensaver ...
-
Am I logged on?
In a scheduled task, I'd like to be able to determine if my Windows
userid (Steve) is actually logged on. By "logged on", I mean having an
active display, and not in screensaver mode. Since my system activates
the screensaver after 10 minutes of inactivity, this means that I'm
actually sitting there doing something, like typing this POST. Put
another way - does the desktop showing display my chosen background?
(The old "Blue Hessian" from OS/2 WARP)
I can't even begin to imagine how this could possibly be done from REXX.
The reason for this is that the scheduled task drives my outbound ADSL
to 100% leaving my network mostly unresponsive. I'd like to be able to
detect this and skip parts of the task, so I don't end up killing it!
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
-
Re: Am I logged on?
Steve Swift wrote:
> In a scheduled task, I'd like to be able to determine if my Windows
> userid (Steve) is actually logged on. By "logged on", I mean having an
> active display, and not in screensaver mode.
I believe the screen saver shows up as a separate PID.
Search the process list for a process ending with .src as the filename.
I do not use a screen saver, but while at a customer site do "C-A-D Enter" to lock my workstation when I am away from my desk. So, there might be situations such as that...
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/
-
Re: Am I logged on?
> I believe the screen saver shows up as a separate PID.
>
> Search the process list for a process ending with .src as the filename.
>
> I do not use a screen saver, but while at a customer site do "C-A-D
> Enter" to lock my workstation when I am away from my desk. So, there
> might be situations such as that...
Ah, thank you for jogging an elderly gentleman's memory. I've been here
before, but forgotten the trick. I even recall the chuckle I had with
the "does the light go out when you close the fridge door" aspect of
this problem - you can only test it whilst the screensaver is active, so
how do you see what your code does? (Actually not very difficult)
I don't use a "real" screensaver, but I think what I do use will run as
a task; the "blank screen" saver. I'll start closing the door, and
looking to see if .scr appears. :-)
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
-
Re: Am I logged on?
Steve Swift wrote:
>> Search the process list for a process ending with .src as the filename.
> I don't use a "real" screensaver, but I think what I do use will run as
> a task; the "blank screen" saver.
The "blank" screensaver turned out to be scrnsave.scr — so far, so good.
Then I added 'logonui.exe' to the processes which signify "not logged
on" as that one generates the "Fast User Switching" logon prompt.
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
-
Re: Am I logged on?
Michael Lueck wrote:
> I believe the screen saver shows up as a separate PID.
This worked fine, thanks.
As a bonus, for an extra 10 points, can anyone think of a mechanism that
would tell my REXX when my display had gone into power-saving mode?
My screensaver normally gets there first, and I detect that, but
sometimes I get into low-power mode without the screensaver starting.
I'm obviously not using the PC (may have fallen asleep at the helm) so
this state should count as \logged_on() as well.
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
-
Re: Am I logged on?
Steve Swift wrote:
> As a bonus, for an extra 10 points, can anyone think of a mechanism that
> would tell my REXX when my display had gone into power-saving mode?
Easiest would be some sort of polling loop.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/