First, hello all !
I need for my application to make screenshots by a local service.
But as you know, in Windows Vista, the window station 0 (services) is isolated from user windows stations.
As soon as I realize a screenshot directly from the service, I get a black image because winsta0 has no interactive desktop
Then, I have two choices:
- My service is launching a program that captures screen, via CreateProcessAsUser. But this solution is bad in my opinion: I must record my image on the disk and read it via the service.
- The second option would be to recover the window station for the current user, and then retrieve his desktop and then make the screenshot.
The problem is that MSDN do not document that correctly.
I do not know how to retrieve the window station of the current user (via the process explorer.exe ???), and how to retrieve the user's desktop to use SetProcessWindowStation and SetThreadDesktop.
Is this second solution is feasible? Or is there process easier?
I do not quite understand the mechanisms of Windows Vista about window stations and desktop.
Sorry for my awful english.
I really need help, thanks in advance to answer me !
PS: I have founded this url's, but the codes always using winsta0/default (probably because Vista was not released when the codes where created)