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

Window app timeout implementation

P: n/a
In our VB.Net Windows application we need to implement
a "timeout" type of funtionality - If the the user leave
the application idle for certain peroid of time, depending
on configureable setting, then I want the system to
timeout and send him/her to login again.

To do this all I need is a client side timer that controls
the timeout. The difficaulty for me is how to implement
the re-setting of the timer. Because any user action in
the application's UI, such as a mouse clicking, a key
strok, sould reset the timer. But how do I capture all
those events? It's almost like that I need a "catch-all"
type of top level event that captures all event. But how
do I do that?

Thanks!
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You'll need to add a message filter to the Application class, this will
PreProcess all windows messages

public class MessageFilter
implements IMessageFilter

public function PreFilterMessage(m as Message) as Boolean
' Pre process message
' Return False and windows will process the message in the normal
way
' or True to not process the message
end function
end class

This will be you "catch-all" top level event

Hope this helps
Neil

"feng" <an*******@discussions.microsoft.com> wrote in message
news:20*****************************@phx.gbl...
In our VB.Net Windows application we need to implement
a "timeout" type of funtionality - If the the user leave
the application idle for certain peroid of time, depending
on configureable setting, then I want the system to
timeout and send him/her to login again.

To do this all I need is a client side timer that controls
the timeout. The difficaulty for me is how to implement
the re-setting of the timer. Because any user action in
the application's UI, such as a mouse clicking, a key
strok, sould reset the timer. But how do I capture all
those events? It's almost like that I need a "catch-all"
type of top level event that captures all event. But how
do I do that?

Thanks!

Nov 20 '05 #2

P: n/a
Thanks for you help!

For some reason I can't make it work. I know that I am
doing something stupid, but I just can't figure out what.

My application is a windows form. So what I do is that I
have my form implement IMessageFilter interface and hoping
that any user events, like mouse click and key strok, will
invoke the function PreFilterMessage. Unfortunityly, this
doesn't happen to me -- the function never get invoked.

Do you see what I am doing wrong here?

Thanks again!
-----Original Message-----
You'll need to add a message filter to the Application class, this willPreProcess all windows messages

public class MessageFilter
implements IMessageFilter

public function PreFilterMessage(m as Message) as Boolean ' Pre process message
' Return False and windows will process the message in the normalway
' or True to not process the message
end function
end class

This will be you "catch-all" top level event

Hope this helps
Neil

"feng" <an*******@discussions.microsoft.com> wrote in messagenews:20*****************************@phx.gbl...
In our VB.Net Windows application we need to implement
a "timeout" type of funtionality - If the the user leave
the application idle for certain peroid of time, depending on configureable setting, then I want the system to
timeout and send him/her to login again.

To do this all I need is a client side timer that controls the timeout. The difficaulty for me is how to implement
the re-setting of the timer. Because any user action in
the application's UI, such as a mouse clicking, a key
strok, sould reset the timer. But how do I capture all
those events? It's almost like that I need a "catch-all"
type of top level event that captures all event. But how
do I do that?

Thanks!

.

Nov 20 '05 #3

P: n/a
Don't worry, I figured it out.

Thanks for your help again!
-----Original Message-----
You'll need to add a message filter to the Application class, this willPreProcess all windows messages

public class MessageFilter
implements IMessageFilter

public function PreFilterMessage(m as Message) as Boolean ' Pre process message
' Return False and windows will process the message in the normalway
' or True to not process the message
end function
end class

This will be you "catch-all" top level event

Hope this helps
Neil

"feng" <an*******@discussions.microsoft.com> wrote in messagenews:20*****************************@phx.gbl...
In our VB.Net Windows application we need to implement
a "timeout" type of funtionality - If the the user leave
the application idle for certain peroid of time, depending on configureable setting, then I want the system to
timeout and send him/her to login again.

To do this all I need is a client side timer that controls the timeout. The difficaulty for me is how to implement
the re-setting of the timer. Because any user action in
the application's UI, such as a mouse clicking, a key
strok, sould reset the timer. But how do I capture all
those events? It's almost like that I need a "catch-all"
type of top level event that captures all event. But how
do I do that?

Thanks!

.

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.