I am creating a script to lock PC's after a given time in hopes of training some staff on locking their PC when they leave their desks. If the script has to lock the PC, the given time is decreased. If the user locks it, it increases. I am having an issue figuring out a way to determine if the user locks the PC. I looked for a way to see if I could setup a hotkey for WIN + L but that got me no where. I've thought about doing some sort of key logging but I am not really interested in going that route unless it is the last resort. I have tried doing a combination of checking if the computer is locked and if it is, check the idle timer, but I couldn't get it accurate enough. Any thoughts or suggestions would be greatly appreciated, thank you.
Edit:
Found a solution here: