Anyway to find out the current Windows is in lock mode?

Posted by David.Chu.ca on Stack Overflow See other posts from Stack Overflow or by David.Chu.ca
Published on 2010-05-18T05:12:16Z Indexed on 2010/05/18 5:21 UTC
Read the original article Hit count: 195

Filed under:

I have a windows application written in VS 2005. The application makes queries against to sql database in a timer cycle every 2 minutes. If there any data changes, the window will be refreshed with new data.

If the user leaves the window, the windows will be automatically locked after a while. There is no sense to keep querying data in ever 2 minutes when the windows is locked; therefore I would like to stop the query when lock is on so that the network data trafic will be reduced and also saves the current windows resources such as memory and CPUs.

I am not sure if there is any way to find out the current windows is locked? Not sure if there is any Windows APIs for this purpose if no .Net classes available?

My project is in .Net 2.0 and all users are in Windows XP.

© Stack Overflow or respective owner

Related posts about visual-studio-2005