473,624 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Has somebody made a surveillance thread which doesn't die?

I have a log-in window application. When the user presses the cancel button
it kills another window by it's name and then it exits. The problem is that
if somebody kills the log-in window by terminating the process in the task
manager the other window is not killed.

One solution might be to have a surveillande thread which doesn't die when
the mother-thread dies, and can't be killed in the task manager. As soon as
the log-in window thread stops responding to surveillance messages it will
kill the other window and then exit.

Is this possible?

I've also tried to have a form which spawns another form, but in the Task
Manager there is only one entry (PasswordDialog .exe). If you kill this
process everything dies and the window which I want to kill when the log-in
window dies is not killed.

--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...sharp/200710/1

Oct 25 '07 #1
3 1830
Don't understand why you need to go through this "killing the process"
business. If you've got a reference to the "other form", why not just close
it?
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"lagu2653 via DotNetMonster.c om" wrote:
I have a log-in window application. When the user presses the cancel button
it kills another window by it's name and then it exits. The problem is that
if somebody kills the log-in window by terminating the process in the task
manager the other window is not killed.

One solution might be to have a surveillande thread which doesn't die when
the mother-thread dies, and can't be killed in the task manager. As soon as
the log-in window thread stops responding to surveillance messages it will
kill the other window and then exit.

Is this possible?

I've also tried to have a form which spawns another form, but in the Task
Manager there is only one entry (PasswordDialog .exe). If you kill this
process everything dies and the window which I want to kill when the log-in
window dies is not killed.

--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...sharp/200710/1

Oct 25 '07 #2
Hi,

If somebody kills your "manager" app from the task manager I think it
receive a signal and only if no response is receive the scheduler simply
kill it.
In any case if the process is forcibly terminated you have no opportunity
to do nothing and there is nothing you can do about.

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"lagu2653 via DotNetMonster.c om" <u27739@uwewrot e in message
news:7a37e1b3ed 787@uwe...
>I have a log-in window application. When the user presses the cancel button
it kills another window by it's name and then it exits. The problem is
that
if somebody kills the log-in window by terminating the process in the task
manager the other window is not killed.

One solution might be to have a surveillande thread which doesn't die when
the mother-thread dies, and can't be killed in the task manager. As soon
as
the log-in window thread stops responding to surveillance messages it will
kill the other window and then exit.

Is this possible?

I've also tried to have a form which spawns another form, but in the Task
Manager there is only one entry (PasswordDialog .exe). If you kill this
process everything dies and the window which I want to kill when the
log-in
window dies is not killed.

--
Message posted via DotNetMonster.c om
http://www.dotnetmonster.com/Uwe/For...sharp/200710/1

Oct 25 '07 #3
lagu2653 via DotNetMonster.c om wrote:
I have a log-in window application. When the user presses the cancel button
it kills another window by it's name and then it exits. The problem is that
if somebody kills the log-in window by terminating the process in the task
manager the other window is not killed.

One solution might be to have a surveillande thread which doesn't die when
the mother-thread dies, and can't be killed in the task manager. As soon as
the log-in window thread stops responding to surveillance messages it will
kill the other window and then exit.

Is this possible?
Sure. Anything is possible, depending only on how much time you want to
put into it and how much of the OS you want to rewrite. :)

That said, your specific idea doesn't sound too hard. But I question
the need for a separate "surveillan ce" thread that can't be killed in
the task manager. There's no such thing in the OS (you can always stop
a process, and all threads exist within a process), so it would indeed
involve hacking the OS pretty severely to introduce that sort of thing.

IMHO, it would be better to just have the "other window" do the querying
of the login window. Have it send a message to the login window every
half-second or so, asking if it should close. The login window, if it
responds at all, will respond in the negative. That is, it will tell
the other window not to close.

If the user presses the cancel button OR if the login window process is
terminated, the login window simply won't respond to the query. In the
former case, the lack of a response will be by choice, in the latter by
necessity. Either way, the other window won't get a response and will
know to close itself.

Designing it this way means you only have to implement a single
behavior, rather than relying on multiple pieces of code implementing
different algorithms to work well together.

The whole thing sounds a bit house-of-cards-ish (why is this
functionality split into two different processes in the first place?),
but assuming you really want something that does what you're talking
about, I see no need to add yet another process to the mix.

Pete
Oct 25 '07 #4

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

Similar topics

0
1588
by: Anto | last post by:
Hello, I'm italian programmer I would have to realize a video program surveillance for cellular and I do not know just from where to begin. Someone has a po' of experience in merit? Practically through the cellular one I would want to be connected to of the television cameras situated in my office Many thanks
5
1471
by: NewToCPP | last post by:
There are several occations where we write onto someone else' memory region. Is there any debugging mechanism to find out which part of the code is causing this problem?
51
54812
by: Hans | last post by:
Hi all, Is there a way that the program that created and started a thread also stops it. (My usage is a time-out). E.g. thread = threading.Thread(target=Loop.testLoop) thread.start() # This thread is expected to finish within a second
4
10328
by: iKiLL | last post by:
Hi all, I am using C# on VS2005. I have a solution with 2 projects, a Webservice and a Client application. Both of these to projects can build compile and run.
34
2777
by: Creativ | last post by:
Why does Thread class not support IDisposable? It's creating quite some problem. Namely, it can exhaust the resource and you have not control over it.
2
1499
by: paeh | last post by:
Can any expert help me. I need to finish up my final project system next year. Can anyone give me some idea how to code my system. My system details is below : 1.Develop modules for a e-Intelligent Surveillance Systems and further enhance the public health monitoring and alert system 2.Develop a web based reporting program for communicable disease that accept electronic laboratory data from NIC health laboratory and other electronic...
0
1118
by: Rambaldi | last post by:
Hey people, I'm working in a project in video surveillance area, so i got a question: Which video surveillance open-source platforms do you know??? and what do think is the best to work with??? Thanks in advance for your answers.
1
2912
by: Rambaldi | last post by:
What is the best free application to manage a video surveillance system in linux? I'm making a project in video surveillance systems and i'm currently researching for free aplications for linux and Windows based systems. Since i dont usually work with linux, maybe here someone have some experience in this camp. Thanks in advance.
0
8231
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
8168
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,...
1
8330
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8471
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...
1
6107
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
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
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.