I am writing a C# service which has to retrieve information from the currently logged on user like the active window or the last mouse movement. I already learned that I can retrieve these information by using the user32.dll but this does only work from within the user context which calls the methods.
This way my service could only retrieve information about itself but not about the "real world" user. I also heared that this should be possible by using WTSEnumerateSessions, OpenWindowStation, EnumDesktops, and so on but I haven't found an example showing me how to do this.
Does anybody have a clue (or maybe some code examples) how to achieve my goal?