Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Inactive user timeout - recommended way ?

$
0
0

Is there a recommended way in WPF of detecting user inactivity ? i.e. no keyboard/mouse input for a specified time, and timing out the application ?

 

Searching the forums and google suggest a heap of different ways e.g. CommandManager.RequerySuggested, hooks into WndProc, Dispatcher.BeginInvoke, GetLastInputInfo user32 method,  DispatcherTimer/ ComponentDispatcher.ThreadIdle/CurrentDispatcher.Hooks.OperationPosted etc.

 

But I can't find an agreed/recommended way of doing this, that has been tried & tested in the field. Looks like I might have some lengthy research to do on this, to explore the various pros/cons of the different approaches, to find the "best" approach. Winforms has application.idle, but not wpf. Any approach needs to work in both standalone WPF exe, and in partial trust XBAP, so a "pure WPF" approach is needed, not Winforms interop.

 

Any recommendations on this ?

 

Thanks,

Andy.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>