By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,894 Members | 2,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,894 IT Pros & Developers. It's quick & easy.

Login form when computer idle

P: n/a
I would like to know how I go about showing a login form whenever the compuer
is idle for 'x' minutes. I only know that it is going to use timers.
--
L. A. Jones
Sep 24 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hello Dave,

And what's wrong with timer?
use Application.Idle +=new System.EventHandler(Application_Idle) where in
the Application_Idle handler set the timer on x secs
Dwould like to know how I go about showing a login form whenever the
Dcompuer is idle for 'x' minutes. I only know that it is going to use
Dtimers.
D>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 24 '06 #2

P: n/a
Does this event have to be attached to every form in my program? If not where
would I place this 'idle' code?

I was in no way hinting that something is wrong in user timers. I said I
knew timers might be used in the solution. --
L. A. Jones
"Michael Nemtsev" wrote:
Hello Dave,

And what's wrong with timer?
use Application.Idle +=new System.EventHandler(Application_Idle) where in
the Application_Idle handler set the timer on x secs
Dwould like to know how I go about showing a login form whenever the
Dcompuer is idle for 'x' minutes. I only know that it is going to use
Dtimers.
D>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 24 '06 #3

P: n/a
Application.Idle is triggered when the 'application' message queue is idle,
that is, when there are no more windows messages to be processed, you don't
want to display a dialog each time this happens do you?
Willy.

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:17***************************@msnews.microsof t.com...
| Hello Dave,
|
| And what's wrong with timer?
| use Application.Idle +=new System.EventHandler(Application_Idle) where in
| the Application_Idle handler set the timer on x secs
|
|
| Dwould like to know how I go about showing a login form whenever the
| Dcompuer is idle for 'x' minutes. I only know that it is going to use
| Dtimers.
| D>
| ---
| WBR,
| Michael Nemtsev :: blog: http://spaces.live.com/laflour
|
| "At times one remains faithful to a cause only because its opponents do
not
| cease to be insipid." (c) Friedrich Nietzsche
|
|
Sep 25 '06 #4

P: n/a

"Dave" <Da**@discussions.microsoft.comwrote in message
news:11**********************************@microsof t.com...
|I would like to know how I go about showing a login form whenever the
compuer
| is idle for 'x' minutes. I only know that it is going to use timers.
| --
| L. A. Jones

What about to turn-on a password protected screen saver?

Willy.

Sep 25 '06 #5

P: n/a
PS
"Dave" <Da**@discussions.microsoft.comwrote in message
news:4D**********************************@microsof t.com...
Does this event have to be attached to every form in my program? If not
where
would I place this 'idle' code?
Do you have one "main" form that opens after the user logs in and remains
open? If you do then that is where you place the code.

Here is some sample code.

private Timer timer;
private void setupTimer()
{
this.timer = new Timer();
this.timer.Interval = 20000;
this.timer.Tick += new EventHandler(this.timer_Tick);
Application.Idle += new EventHandler(this.Application_Idle);
}

void Application_Idle(object sender, EventArgs e)
{
this.timer.Stop();
this.timer.Start();
}

void timer_Tick(object sender, EventArgs e)
{
// log user off
}

PS
>
I was in no way hinting that something is wrong in user timers. I said I
knew timers might be used in the solution. --
L. A. Jones
"Michael Nemtsev" wrote:
>Hello Dave,

And what's wrong with timer?
use Application.Idle +=new System.EventHandler(Application_Idle) where in
the Application_Idle handler set the timer on x secs
Dwould like to know how I go about showing a login form whenever the
Dcompuer is idle for 'x' minutes. I only know that it is going to use
Dtimers.
D>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do
not
cease to be insipid." (c) Friedrich Nietzsche
Sep 25 '06 #6

P: n/a
PS

"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:%2******************@TK2MSFTNGP05.phx.gbl...
Application.Idle is triggered when the 'application' message queue is
idle,
that is, when there are no more windows messages to be processed, you
don't
want to display a dialog each time this happens do you?
Michael was suggesting that the timer be started in this event. I have
implemented the same concept without problems.

Regards,

PS
>

Willy.

"Michael Nemtsev" <ne*****@msn.comwrote in message
news:17***************************@msnews.microsof t.com...
| Hello Dave,
|
| And what's wrong with timer?
| use Application.Idle +=new System.EventHandler(Application_Idle) where
in
| the Application_Idle handler set the timer on x secs
|
|
| Dwould like to know how I go about showing a login form whenever the
| Dcompuer is idle for 'x' minutes. I only know that it is going to use
| Dtimers.
| D>
| ---
| WBR,
| Michael Nemtsev :: blog: http://spaces.live.com/laflour
|
| "At times one remains faithful to a cause only because its opponents do
not
| cease to be insipid." (c) Friedrich Nietzsche
|
|

Sep 25 '06 #7

P: n/a

"PS" <ec***********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
|
| "Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
| news:%2******************@TK2MSFTNGP05.phx.gbl...
| Application.Idle is triggered when the 'application' message queue is
| idle,
| that is, when there are no more windows messages to be processed, you
| don't
| want to display a dialog each time this happens do you?
|
| Michael was suggesting that the timer be started in this event. I have
| implemented the same concept without problems.
|

The OP was asking about the SYSTEM being idle not an APPLICATION being idle.
Now, what happens if the user switches to another application, are you going
to display a login dialog after the other application has been 'idling' for
a while, even if the user did not leave it's workplace? Quite annoying for
the user isn't it?

Willy.
Sep 25 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.