How to find windows in other sessions
For one of my applications I have had to move to a service architecture (mostly for vista). One function I noticed isn't working is a system that finds windows. It makes sense because services in Vista operate in sessions 0, and there is no GUI for session 0.
However, I still have a need to find a window with a certain title (it is part of some half-assed authentication system) in a user's session. I actually do not care if I find windows for ALL users vs a particular user. I messed with this before and didn't find a good solution, but maybe someone can suggest something that I have overlooked. Currently the only information I have about the user is their user name, however I can get more information if need be.
[752 byte] By [
DeepT] at [2007-11-20 11:47:44]

# 1 Re: How to find windows in other sessions
The real problem is that services normally operate in separate window station, and each session posesses the desktop object, and any window-related function can operate only within the desktop it was created in. And this has nothing to do with Vista, because this behavior is present since earliest Windows NT ages. :D
So the solution would be to create a thread that belongs to a Default desktop of interactive window station WinSta0 and perform all needed operations in its context.