views:

245

answers:

2

Hi,

We have a service that launches an application that will interact with the logged on user. The application we launch is always run as a specific user for which we have the credentials. We do what is necessary (get active session ID, logonUser, adjust token) and launch the application with CreateProcessAsUser in the winsta0\Default desktop.

Everything is working fine if the color scheme of the Vista PC is Aero - but under the basic and classic color schemes, the application is still launched but none of the windows are painted. There is a new task on the taskbar. If you minimize a window which was in the background and in full screen, then you can see the contour of our ghost app - you can move it around, it will respond to keyboard/mouse input just fine. It's just invisible, not painted.

Does anyone has any idea of what could be happening? Why with the Aero color scheme it's fine but not in the others?

Thanks for any help,

Frank

+1  A: 

It sounds pretty weird - you may have hit on an actual bug in Vista since it seems unlikely many other people have tried what you are doing.

First of all I'd make sure the problem doesn't exhibit this behaviour when run by the logged in user directly, just to pin it down to whether it's a Aero/Classic issue or a winstation issue.

Secondly I'd attach to the process with a debugger and make sure the message loop is getting various significant messages, particularly WM_PAINT :)

But this is obscure enough that your only option may be to open a paid support issue with Microsoft.

U62
A: 

There may also be a problem if you have user-drawn controls on your form (or your form itself is user-drawn). If you only paint the form if Application.RenderWithVisualStyles is true, you may see this behaviour. So make sure you also render stuff without these styles. More information how your form looks/behaves/etc would be appreciated.

Scoregraphic
Why do you assume this is .NET WinForms?
Aardvark
Because I've seen similar behaviour there, but it's still just an assumption.
Scoregraphic