Windows service couldnt get screenshot in windows 7

前端 未结 2 695
清酒与你
清酒与你 2020-11-29 13:09

I have a windows service which gets the screenshots. But its creating only black screens. I know this happens because of session 0 isolation. I searched on internet and coul

2条回答
  •  甜味超标
    2020-11-29 13:36

    Is there a way to change the session of a windows service and get the desktop screen of another user's session like session 1, session 2?

    No.

    Is there a way to start a console application which runs in an another session other than session 0 from a windows service?

    This can be done but it's messy. It involves impersonation of the logged on user, manipulation of user tokens, and launching a process into a different session with CreateProcessAsUser(). This article describes what is needed.

    As an aside, you don't want a console application because that will splat a console window on your screenshot. You just want a standard Windows app (using the GUI subsystem) but one that does not show any visible windows.

提交回复
热议问题