I use CreateDialogParam
to create a dialog in my service, it can run normally in XP system.But when I put it into Vista or Win7, it doesn't work. I want to know why or what else APIs I can use?
-
Why not just separate the UI of your application from the part that runs as a service? Then your UI can display dialog boxes all it wants. This is the approach taken by most commercial software packages.– Daniel PrydenOct 12, 2011 at 6:11
-
But the project is someone left over. I should fix the BUG soon, so it is no time. Is someone else meet this problem before?– SlotLovesSignalOct 12, 2011 at 6:17
2 Answers
With session 0 isolation introduced in Vista, services cannot show UI since they run in a separate, non-interactive session. You need to run a standard app on the interactive desktop and use an IPC mechanism to communicate with the service in order to show UI on behalf of the service.
Read Microsoft's documentation about the changes made to services in Vista.
http://msdn.microsoft.com/en-us/library/ms683502.aspx
http://msdn.microsoft.com/en-us/library/aa480152.aspx#appcomp_topic12
http://msdn.microsoft.com/en-us/windows/hardware/gg463353.aspx