This app locks Windows session when laptop lid is closed UNLESS there is an external display connected to the laptop.
This app does not have window or tray icon. If you want to close it you need to use Task Manager.
You probably want to start it at log on automatically. Use Task Scheduler for it.
You can build it yourself or use LidLock.exe
. It requires .NET Framework 4.6 which is included with Windows 10.