Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-07-02
4
Medium Priority
?
1,092 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

610 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