Execute program capturing screenshots from windows service
<p>I'm writing a windows service, which will manage some agent program capturing screenshots. Agent program works fine, no problems at all - it just takes screenshot and saves it into bmp file.
But when i try to execute this agent program from my service - it doesnt't work, all i get is black pictures (as if i tried to capture screenshot directly from my service)
My code inside service is:</p>

<pre><code>ServiceStatus.dwCurrentState = SERVICE_RUNNING;
SetServiceStatus (hStatus, &amp;ServiceStatus);

SHELLEXECUTEINFO seInfo;
seInfo.cbSize = sizeof(SHELLEXECUTEINFO);
seInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
seInfo.hwnd = NULL;
seInfo.lpVerb = TEXT("open");
seInfo.lpFile = TEXT("D:\\dev\\work\\agent.exe");
seInfo.lpDirectory = TEXT("D:\\dev\\work\\");
seInfo.nShow = SW_SHOWNORMAL;
seInfo.hInstApp = NULL;

ShellExecuteEx(&amp;seInfo);
</code></pre>

<p>I tried to change service properties - to allow it interacting with desktop, change service user from SYSTEM to my local account - nothing helpes. 
What can i do to make it work properely?</p>

<p>UPD. Well, i suppose, this happenes because my service executes program in session0. I tried <code>CreateProcess()</code> and <code>CreateProcessAsUser()</code> as well - no result. So how can i create procees NOT in session0?</p>