locked
can a windows service open and use a desktop under vista/win 7? RRS feed

  • Question

  • hi all, i have an application that i use to test/monitor other application (for example it makes run same desktop app and if samething is wrong save same log and make a snapshot of the desktop).

    i would like to have it as a windows service.

    i read that it cannot works with user desktop under vista/win 7 but i don't understand if it cannot works with the desktop in general or only with the desktop of same logged user: i mean, a windows service can log to windows with a desktop account and runs desktop applications as if them were started by a real user?

    Monday, November 22, 2010 3:30 PM

Answers

  • There really isn't a good way to know what is on display from the service short of writing a display driver filter- the machine could have multiple user sessions concurrently, and each session can have different desktops (logon,application, screensaver, etc). It is very hard to spawn a process that is not in the service desktop from a service, and after you get out to a user session you may still need to access a different desktop.

    It would be much easier if you remove the windows service requirement and capture from a program within the same session of your app.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by developer00 Wednesday, November 24, 2010 8:33 AM
    Wednesday, November 24, 2010 5:27 AM

All replies

  • The desktop applications would still be in the same session, share the same winstation desktop.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, November 23, 2010 12:06 AM
  • sorry i haven't understand your reply, can you explain better please
    Tuesday, November 23, 2010 8:22 AM
  • There really isn't a good way to know what is on display from the service short of writing a display driver filter- the machine could have multiple user sessions concurrently, and each session can have different desktops (logon,application, screensaver, etc). It is very hard to spawn a process that is not in the service desktop from a service, and after you get out to a user session you may still need to access a different desktop.

    It would be much easier if you remove the windows service requirement and capture from a program within the same session of your app.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by developer00 Wednesday, November 24, 2010 8:33 AM
    Wednesday, November 24, 2010 5:27 AM