473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

enumeration of windows on desktop in c# ?

hello

Is it possible (and how) to enum all windows on desktop in c# ?
I need this to write a program which closes miscelanious windows
with various titles.
Nov 17 '05 #1
3 2517
aspirit,

Hmm, I don't think you can do that without using PInvoke and calling API
methods. Only think you can do is using the Process class from the
Diagnostics namespace and get all processes in the system. From there you
can get their main window if one is present. You can close that window (and
possibly close the application, but I don't think you can enumerate all
windows.


--

Stoitcho Goutsev (100) [C# MVP]

"aspirit" <as*****@o2.pl> wrote in message
news:dl**********@nemesis.news.tpi.pl...
hello

Is it possible (and how) to enum all windows on desktop in c# ?
I need this to write a program which closes miscelanious windows
with various titles.

Nov 17 '05 #2
Hi,
using pinvoke maybe the only way in which case you have to call
EnumWindows/EnumChildWindows api.

Ab.
http://joehacker.blogspot.com

"aspirit" <as*****@o2.pl> wrote in message
news:dl**********@nemesis.news.tpi.pl...
hello

Is it possible (and how) to enum all windows on desktop in c# ?
I need this to write a program which closes miscelanious windows
with various titles.

Nov 17 '05 #3
Abubakar wrote:
Hi,
using pinvoke maybe the only way in which case you have to call
EnumWindows/EnumChildWindows api.
Ab.
http://joehacker.blogspot.com
Stoitcho Goutsev (100) [C# MVP] wrote: aspirit,
Hmm, I don't think you can do that without using PInvoke and calling API
methods. Only think you can do is using the Process class from the
Diagnostics namespace and get all processes in the system. From there you
can get their main window if one is present. You can close that window (and
possibly close the application, but I don't think you can enumerate all
windows.


thanks both of you

aspirit
Nov 17 '05 #4

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

Similar topics

1
by: Justin Wright | last post by:
I know that I can set up an enumeration as follows ( just typed in quick so may have syntax errors ): <xsd:simpleType name="colors"> <xsd:restriction base="xsd:string"> <xsd:enumeration...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
3
by: Elp | last post by:
Hi, I have developped a Windows applcation (in C#) that allows, among other things, users to view and control the desktop of a remote Windows XP Pro machine. I have actually simply embedded the...
3
by: Sampson | last post by:
I have a question about enumeration and how to populate them during runtime. I am using vb.net but will happily take any advice in c# as well. Here is an example to help illustrate what I am...
7
by: Nathan | last post by:
I'd like to use an enumeration as a datasource for a drop-down box. Is there a way to do this?
15
by: =?Utf-8?B?TVNU?= | last post by:
To demonstrate my problem, I have a very simple VB Windows application. It has a text box that is used to display a counter, a button to reset the counter, and a timer that increments the counter...
41
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...
0
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,...
0
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...

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.