implementation of "show me as idle for x mins"
-
Hi, Does anybody has any idea how to give implementation in c-sharp, of the following feature of Yahoo or MSN: Show me as "Away" when I am inactive for 10 minutes. I have a chat client application developed in c-sharp. And now I want to give the same feature in my app too. Prompt reply will be appreciated. Regards, Kamran
-
Hi, Does anybody has any idea how to give implementation in c-sharp, of the following feature of Yahoo or MSN: Show me as "Away" when I am inactive for 10 minutes. I have a chat client application developed in c-sharp. And now I want to give the same feature in my app too. Prompt reply will be appreciated. Regards, Kamran
You could take a timestamp everytime the user of your application does something and store it somewhere. This timestamp value then gets compared with the actual time inside of an timer event handler and if the difference is greater than 10 min you set the status to "Away".
-
Hi, Does anybody has any idea how to give implementation in c-sharp, of the following feature of Yahoo or MSN: Show me as "Away" when I am inactive for 10 minutes. I have a chat client application developed in c-sharp. And now I want to give the same feature in my app too. Prompt reply will be appreciated. Regards, Kamran
Simple solution - have a timer that ticks every so often (depending on how accurate you want your away timer to be) Every time the timer ticks, increment the counter, when the counter goes above a pre-set value (i.e. how ever many timer ticks there are in 10 minutes) you can set your status to away. Now, in any of your mouse/keyboard handlers, just reset that counter to zero if you've got user input -- Help me! I'm turning into a grapefruit! Phoenix Paint - back from DPaint's ashes!
-
Simple solution - have a timer that ticks every so often (depending on how accurate you want your away timer to be) Every time the timer ticks, increment the counter, when the counter goes above a pre-set value (i.e. how ever many timer ticks there are in 10 minutes) you can set your status to away. Now, in any of your mouse/keyboard handlers, just reset that counter to zero if you've got user input -- Help me! I'm turning into a grapefruit! Phoenix Paint - back from DPaint's ashes!
Hi Benjymouse, Thanks for your prompt reply. It helps me a lot to understand the solution. But how to capture mouse/keyboard events of windows. Remember my chat application application needs to be notified of any activity on windows for example if my chat application is minimized, and a user only moves his mouse on the desktop, my application should be able to capture this event. I hope you understand what i mean. Regards, Kamran dearkami@yahoo.com
-
Hi Benjymouse, Thanks for your prompt reply. It helps me a lot to understand the solution. But how to capture mouse/keyboard events of windows. Remember my chat application application needs to be notified of any activity on windows for example if my chat application is minimized, and a user only moves his mouse on the desktop, my application should be able to capture this event. I hope you understand what i mean. Regards, Kamran dearkami@yahoo.com
Yes, of course. Sorry - I didn't think that far. You'll need keyboard and mouse hooks, that'll let you monitor what's going on outside your application There's a few articles on how to do this here on Codeproject: Processing Global Mouse and Keyboard Hooks in C#[^] Global System Hooks in .NET[^] Using Hooks from C#[^] One of those should be able to get you going! -- Help me! I'm turning into a grapefruit! Phoenix Paint - back from DPaint's ashes!
-
Yes, of course. Sorry - I didn't think that far. You'll need keyboard and mouse hooks, that'll let you monitor what's going on outside your application There's a few articles on how to do this here on Codeproject: Processing Global Mouse and Keyboard Hooks in C#[^] Global System Hooks in .NET[^] Using Hooks from C#[^] One of those should be able to get you going! -- Help me! I'm turning into a grapefruit! Phoenix Paint - back from DPaint's ashes!
Thanks a lot Benjymous, I hope this will help me to resolve my problem. Thanks again! Best regards, Kamran