You can lock a Windows PC by pressing Windows + L.
How can I lock a Windows PC using VB.NET or C#?
A short example would be helpful
Call the LockWorkStation function using PInvoke.