Im try to create console app in c#, that will run all day and will fight against Enforcing lock screen after idle time via GPO. Basicaly its working but I need somehow catch event in the app if screen lock is actived or unactived. Here is the code https://github.com/devuserPP/AutoClicker.
I ques could be possible over this https://learn.microsoft.com/en-us/windows/win32/termserv/wm-wtssession-change?redirectedfrom=MSDN. Problem is Im beginer in c# and do not have idea how implement this.
Can someone help me or advice what is the best way to solve this task.
Thank you in advance.