473,419 Members | 1,790 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,419 software developers and data experts.

idle, zlock, active user

Hello,

I would like to know how i can detect if a user
is online, in idle time or lock session.
I know how to do this in C++ but i don't know in C#.

In C++, for idle you can use GetLastInputInfo.
and for lock session, OpenInputDesktop
(DF_ALLOWOTHERACCOUNTHOOK, TRUE,DESKTOP_CREATEMENU |
DESKTOP_CREATEWINDOW |DESKTOP_ENUMERATE |
DESKTOP_HOOKCONTROL |DESKTOP_WRITEOBJECTS |
DESKTOP_READOBJECTS |DESKTOP_SWITCHDESKTOP |GENERIC_WRITE);

and if OpenInputDesktop return NULL, the session is locked.

How do you do this in C#.

Thanks.

Romeo
Nov 15 '05 #1
0 10467

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Will Seay | last post by:
At the end of this message I've pasted a script we're trying to modify slightly. I don't believe it is VBscript or javascript but these are the closest groups I could find with my limited...
17
by: los | last post by:
Hi, I'm trying to create a program similar to that of Google's desktop that will crawl through the hard drive and index files. I have written the program and as of now I just put the thread to...
1
by: Nukeation | last post by:
Hi, I want to activate a special app / form when the user comes back to his computer after being idle for a while. I would also like to find out how long the user has been away. My app does not...
2
by: Keith Wilby | last post by:
The link below: http://support.microsoft.com/default.aspx?scid=kb;en-us;128814 to the Microsoft KB "Detect Idle Time" article shows how to detect "idle" time. However, if a user is active but...
1
by: jdph40 | last post by:
I am using Access 2002. I downloaded the forms sample database FrmSmp97.mdb from Microsoft and used the following code in the timer event of a hidden form in order to close a database if no...
2
by: henk | last post by:
I have a hard time to get the idle time only from my application. (a relogin box should appear after eg 1 min, when a user switch to word and start typing for 10min, the re-login should not appear....
1
by: Praveen_db2 | last post by:
Hi All I came across a small doubt. Suppose I have Max Connections parameter set to 200. There are now 200 connections to the database. Out of these 200 connections 50 are idle. What will happen...
0
by: MIke Kansky | last post by:
I need to detect when user's computer goes to idle mode. I also need to detect when user's computer comes back from the idle mode. I have an application running in Sys Tray that should let the...
5
by: hmy | last post by:
Hi, I need to lock my application if it has been idle for 15 minutes. This is a windows application in c#. I have put a timer in the main form and implemented the IMessageFilter interface. In the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.