Since this is homework, here some starting points
-
Create a local hook on explorer.exe
-
Find out if you can use WinAPI to find process information on the explorer
-
…
-
execute shutdown.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms644960(v=vs.85).aspx