Enumerating Windows through Service

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

Hey There,
I am trying to get a list of the open windows from a Windows
Service. My initial code was written in a regular server and the window
listing function EnumWindows worked fine, but when I ported my code
over to the service, then it stopped working. I saw that this is due to
a service running on a different "non-interactive" dekstop than a
regular user desktop. How would I get a service to just get the window
handles of the currently open windows? The process itself won't need to
open any windows, so I need the interaction to be as minimal as
possible. Any ideas?

-Jay
(patelj27b at gmail dot com)
 
I am trying to get a list of the open windows from a Windows
Service. My initial code was written in a regular server and the window
listing function EnumWindows worked fine, but when I ported my code
over to the service, then it stopped working. I saw that this is due to
a service running on a different "non-interactive" dekstop than a
regular user desktop. How would I get a service to just get the window
handles of the currently open windows?

You've identified the root of the problem, but which desktop do you
want? What about terminal server and XP fast user switching operation?

What are you really trying to achieve? There may a better way of
doing what you want.

Dave
 
Back
Top