To solve this problem, you should monitor incoming explorer.exe messages using the Win32 API hooks. If you do not know about the Win32 API, I suggest you read a book about it and spend some time practicing, because the Win32 API and its interceptors cannot be explained in short words of this answer.
C # is not the best tool for creating dry things, at least interception should be done in C (++), so you need to learn it. In fact, learning the Win32 API along with C (++) can take a year or two before the task becomes solvable.
source share