473,773 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2570
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.p l> 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/EnumChildWindow s api.

Ab.
http://joehacker.blogspot.com

"aspirit" <as*****@o2.p l> 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/EnumChildWindow s 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
12633
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 value="red"/> <xsd:enumeration value="yellow"/> <xsd:enumeration value="blue"/> </xsd:simpleType>
383
12250
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 poor man's DBMS, a broken email server and various other /application/ servers to try and crack the Internet and IS markets. In the case where they didn't spend their own money to get companies to
3
6376
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 Remote Desktop ActiveX control in my C# app and this works fine. However i have now a new requirement for my app: multiple users have to be able to view and control the same remote desktop simultaneously using my application. Big problem:...
3
10630
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 after. Create a class named “clsMyItems” and in that class place an enum. Public Enum Items Item1 = 0 Item2 = 1 Item3 = 2
7
4457
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
7088
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 every second. I remote desktop to the computer hosting this application and run the application. It starts up and displays the counter incrementing every second. If I disconnect the network cable between the two computers for 10 seconds and...
41
11663
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 exits immediately with a start/stop/nothing to do error. What could be wrong?
0
30246
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 a comprehensive list of all autostart locations for Windows OSes: NOTE : These are some abbreviations used in this list. Please note them carefully: HKCU = HKEY_CURRENT_USER HKLM = HKEY_LOCAL_MACHINE
0
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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
10106
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
9914
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
8937
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...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.