Delphi Code for Cancelling or Continuing the lock attempt and Display an Alert When User Locks Computer

147 Views Asked by At

This is a toughie (I am obviously new to Stack Overflow)! Delphi code for displaying an alert (reminder) to sign out when a user locks their PC. I believe this would need:

  1. Detect locking their Windows 7 or 10 computer / workstation.

  2. Display a MessageDlg with 2 buttons: "Lock" (proceed with locking computer) and "Cancel Lock" (so that they can sign out online and then lock their computer).

This could possibly be an executable installed on their local computer that would run on StartUp in the background.

Please note, I have created simple Delphi programs in Delphi 6 for years but this is way above my "pay grade". If this is even possible MANY thanks for your time !! You cannot begin to imagine how helpful this would be!

Scott

I tried copying "How Do I detect a user locking / unlocking a screen in Windows 7". It did not have the lock cancelling feature that would allow a user to perform another task before locking their computer.

1

There are 1 best solutions below

3
SilverWarior On

As far as I know it is not possible to prevent user from locking the computer. In fact it is quite common practice to have computers set up in a way so that they lock themselves automatically after certain time of user inactivity.

This can greatly improves overall IT security as in most cases prevents random person getting access to unlocked computer just because person that is otherwise using this computer stepped away for a few minutes.

Now if your program would somehow prevent this from happening you would be potentially compromising IT security.

In fact I suspect that you might want to actually increase IT security by forcing your users to regularly log out of the online system. But this is not the way to do it.

It would be much better if your online service would use time limited session management. What I mean by this? I mean that online service session should time-out after user hasn't performed any activity in this online service for certain time.