473,804 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enumerating Windows through Service

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)

May 8 '06 #1
1 1136
> 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
May 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1350
by: Brett Mostert | last post by:
Hi, I need to be able to Enumerate through Printer Drivers, ports, printers and so fourth. And even add printers, ports, and drivers and setup printers. Sofar i can do all of the following except anything to do with drivers. I have added a reference to the PRNADMIN.DLL from MS Windows 2003 Tool Kit into my project to do all of the above, but when i try to enumerate printers i received the following error....
7
3170
by: Rohan Ranade | last post by:
I am trying to implement a crawler in C# that scans all the shared folders in remote computers in a windows network. Are there classes in .NET to do this directly? Please help. Thank You. Rohan
4
6999
by: Brett Mostert | last post by:
Hi, I need to be able to Enumerate through Printer Drivers, ports, printers and so fourth. And even add printers, ports, and drivers and setup printers. Sofar i can do all of the following except anything to do with drivers. I have added a reference to the PRNADMIN.DLL from MS Windows 2003 Tool Kit into my project to do all of the above, but when i try to enumerate printers i received the following error....
1
1749
by: José Achig | last post by:
Hi all, The service I have written can not enumerate the current user's desktop windows when running as a service. I read where one solution to this is to install the service with "SystemAccount" rights and "Allow service to interact with desktop" but I know it leaves the system vulnerable to maliciousness. Is there a way to programmatically enumerate through the current desktop
2
4577
by: Tony | last post by:
I have this problem - I have a hashtable, containing a list of filenames. Every 60 seconds, I have a thread that enumerates thru this hashtable, and based on some simple logic, some of the items in the hashtable has to be removed. But when I remove a pair from the hashtable, inside the enumeration loop, I get an exception. Why cant I remove from a hashtable, while enumerating ?
0
951
by: wifetalks | last post by:
I'm enumerating the computers in the domain to a listview control on my form, but how do I include the comments. Like what you would see in Windows Explorer when you browse the domain. On our domain, the computer names are insignificant (Dell service tag), so we include the user's name in the comments (computer description). Using WinXP, the explorer displays this comment when viewing in Tiles or Details view. How do I get this...
5
1351
by: Jay | last post by:
Hey There, I have this function that is called through EnumWindows: BOOL CALLBACK EnumOpenWindows(HWND hwnd, LPARAM lParam) { DWORD dwID; LPDWORD dwID2; LPDWORD currProcId; FILE* fp; struct _HwndProcStruct* locHPStruct;
0
1381
by: Simon Verona | last post by:
I have a problem on a specific pc... On the PC, in control panel Printers there are a few printers listed, including a printer that is a network share on another PC. I have some code that adds these printers to a combobox so that the user can pick a printer, this code is : ====================================== Dim pkInstalledPrinters As String ' Find all printers installed
4
2843
by: nagar | last post by:
On certain occasions I get COM exceptions errors when enumerating the Windows Explorer active windows Some customers reported the error System.OutOfMemoryException: Retrieving the COM class factory for component with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} failed due to the following error: 8007000e. Here's the code I use to retrieve the list of IE windows. Are there better solutions that prevent the exceptions?
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9175
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.