Solved

How do I get EnumWindows working from a Windows Vista Service?

Posted on 2009-07-02
4
1,040 Views
Last Modified: 2012-05-07
Hi Guys,

I have written a program that collects information about programs running on the windows desktop using the EnumWindows API.  My program runs fine on Windows XP when run on the command line or as a service and Windows Vista on the command line.  My program fails though when I try to run my program as a service on Windows Vista.

Does anyone know why EnumWindows does not find any windows when run as a service on Windows Vista?

Thanks
Grant
0
Comment
Question by:Grant Rogers
  • 2
4 Comments
 
LVL 14

Expert Comment

by:uucknaaa
ID: 24761694
Hi

With new service hardening, vista services will run in session 0 and can no longer interact with the desktop.  That's probably what's preventing your service from running.

Hope that helps.
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 24762924
That's not new to Vista. All services run on their own desktop without any access to the logged on user's desktop, see http://support.microsoft.com/kb/115825 ("Accessing the Application Desktop from a Service"). Vista has only taken that to a new level with WTS features coming into play. http://blogs.msdn.com/larryosterman/archive/2005/09/14/466175.aspx ("Interacting with Services") should give you an idea on how to procedd by havina an app running in the user's context o the enumeration for you.
0
 

Author Comment

by:Grant Rogers
ID: 24768155
Thanks guys, I will have a look into this and let you know my results.
0
 

Author Comment

by:Grant Rogers
ID: 24821993
Hi jkr,

I have tried the knowlegebase article KB115825 but that did not work.  Are you able to provide some sample code of how to access desktop information from a service?

Thanks
Grant
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now