473,326 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Window app timeout implementation

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
3 3337
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bilal | last post by:
Hi, I'm a complete beginner in Javascript and php ... so forgive me for asking an easy/simple solution to the following problem: I'm developing an application that involves multi-screen in...
0
by: Bilal | last post by:
Hi, I'm a complete beginner in Javascript and php ... so forgive me for asking an easy/simple solution to the following problem: I'm developing an application that involves multi-screen in...
1
by: jnair | last post by:
When using socket.socket.settimeout we normally only guard against "socket.timeout" exception.Now the implementation of "settimeout" in "Python-2.4.3/Modules/socketmodule.c" sets the socket fd to...
1
by: a.r.austin | last post by:
Hello, I am trying to download a few files one after another from a remote server. Problem is that I don't know how to, or if I am able at all, set a time out for download. I don't want to time...
1
by: CutCopyPaste | last post by:
Hi , I am trying to open a modal window but if t he window is already opened i need to just set the focus back . The Code is working fine in one environment but not live system on live system...
2
by: Zytan | last post by:
I just had the problem occur again, with NetworkStream.Write() doing its thing with a timeout... and it just sits and waits and waits and waits... it never times outs. So, I shut the server down...
1
by: bizt | last post by:
Hi, I have a process where every so often I refresh a table's data using a setTimeout() .. and when its no longer needed, a clearTimeout(). The following is a simple example of how this is...
4
by: goscottie | last post by:
I used submodal as my popup window. With some tweaks, it working great in my app. However, I can't find a way to detect session timeout in the popup window. The app is a form based...
3
Airslash
by: Airslash | last post by:
Hello, I've written my own TCPClient and TCPServer class components to handle traffic over the network between applications. When I test the components locally they work. In the local network...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.