473,395 Members | 1,583 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,395 software developers and data experts.

Question related to multi-threading

Hi:

I'm running a thread that displays a messagebox. I want the messagebox to
close when the thread aborts, but I've had no luck in doing so. A simple
call to thread.abort doesn't work. Anyone know what I may be doing wrong?
Nov 16 '05 #1
4 1078
Roger,

The messagebox is a modal dialog that waits for the user to dismiss it.
The only way you will be able to shut it down is to find the windows handle,
and send a message to it (which isn't the easiest to find).

You might want to think of some sort of event notification that fires
when your thread is done processing, as well as some custom display that you
can easily hide/dispose of when the event notification is fired.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Roger" <so*****@microsoft.com> wrote in message
news:eL**************@TK2MSFTNGP11.phx.gbl...
Hi:

I'm running a thread that displays a messagebox. I want the messagebox to
close when the thread aborts, but I've had no luck in doing so. A simple
call to thread.abort doesn't work. Anyone know what I may be doing wrong?

Nov 16 '05 #2
Thanks
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eA**************@TK2MSFTNGP09.phx.gbl...
Roger,

The messagebox is a modal dialog that waits for the user to dismiss it.
The only way you will be able to shut it down is to find the windows
handle, and send a message to it (which isn't the easiest to find).

You might want to think of some sort of event notification that fires
when your thread is done processing, as well as some custom display that
you can easily hide/dispose of when the event notification is fired.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Roger" <so*****@microsoft.com> wrote in message
news:eL**************@TK2MSFTNGP11.phx.gbl...
Hi:

I'm running a thread that displays a messagebox. I want the messagebox
to close when the thread aborts, but I've had no luck in doing so. A
simple call to thread.abort doesn't work. Anyone know what I may be
doing wrong?


Nov 16 '05 #3
Keep all things related to user-interface in the primary thread (and vice
versa - i.e. the primary thread doesn't have to deal with anything else other
than the UI, that way it shouldn't get blocked up).
Then just transfer control back to the primary thread in order to display
the message box. The main form then won't be able to be closed until the
message box is dismissed.

"Roger" wrote:
Hi:

I'm running a thread that displays a messagebox. I want the messagebox to
close when the thread aborts, but I've had no luck in doing so. A simple
call to thread.abort doesn't work. Anyone know what I may be doing wrong?

Nov 16 '05 #4
I got the same problem with that as well, could you please give me a sample
of code how to do so. Thank you
"Patty O'Dors" wrote:
Keep all things related to user-interface in the primary thread (and vice
versa - i.e. the primary thread doesn't have to deal with anything else other
than the UI, that way it shouldn't get blocked up).
Then just transfer control back to the primary thread in order to display
the message box. The main form then won't be able to be closed until the
message box is dismissed.

"Roger" wrote:
Hi:

I'm running a thread that displays a messagebox. I want the messagebox to
close when the thread aborts, but I've had no luck in doing so. A simple
call to thread.abort doesn't work. Anyone know what I may be doing wrong?

Nov 16 '05 #5

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

Similar topics

1
by: Randy Geyer | last post by:
Which group should I post this too? Thanks!
2
by: John Pollins | last post by:
Greetings, We are trying to set up a set of "Leading Practices" for our developers, as well as ourselves, and hope some gentle reader can recommend some documentation in favor of what appears to...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
1
by: Tom Lee | last post by:
Hi Guys, I have two tables, table A and table B. I would like to acheive Table A is one to many relationship with table B, where is related by . I have created a form (bound to A) and a multi...
2
by: deko | last post by:
This may be an easy question, but for some reason the multiple table design idea is throwing me. I'm trying to avoid using one large, wide table - so I've got multiple tables that hold different...
1
by: herrcho | last post by:
#include <stdio.h> int multi; int main() { printf("\nmulti = %u",multi); printf("\nmulti = %u",multi); printf("\n&multi = %u\n",&multi); return 0;
1
by: Hardy Wang | last post by:
Hi, Guys I am currently working with a multi-language project, and I have a question, is System.Text.Encoding.Default related to machine (locale English, French, Chinese and etc) or independent?...
4
by: WStoreyII | last post by:
I am Making a Collection for categories There will be three fields Category Major And Minor For the Category i need to know what Type it is Expense/income for the major i need to know the cat...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
2
by: johkar | last post by:
I have several related multi-selects on a page (country, state/ province, city, address). There are 4 - 7 other unrelated fields on the page also. Even though this is an intranet app where a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...

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.