0
Reply

screen Shot with windows service

Ahmar Husain

Ahmar Husain

Mar 27 2013 2:48 AM
3.3k
I have written a window service (local system) which is intended to capture screen shot of user's desktop after every 10 minutes and save it into a local folder of D drive , i tested my service on windows XP it worked fine but on windows vista and windows 7 it is not working when installing the service i enabled "Interact with user's desktop" after doing some more research on it i got to know to know in earlier versions of Microsoft windows all services were started into the same session in which user has logged in but in Vista and later services are started in Session 0 while user logs in Session >0 which is Session 0 isolation so when my service tries to take screenshot it actually takes of Session 0 desktop which is blank Microsoft has done it to prevent shatter attack  ,this is quite bizarre rather than making service secure microsoft has pulled out one functionality but i still want to do it without using any registry hack  i tried an alternate solution too in which i wrote screen capture code in a console application and called it via service periodically but results were same  , any help will be greatly appreciated . 
those who want to have a look on my code can contact me at [email protected] .