Click here to Skip to main content
15,916,280 members
Home / Discussions / C#
   

C#

 
QuestionHow to paste external window to my form? Pin
..Hubert..14-Jul-03 1:37
..Hubert..14-Jul-03 1:37 
GeneralChanging the Form's title text Pin
eggie513-Jul-03 22:02
eggie513-Jul-03 22:02 
GeneralRe: Changing the Form's title text Pin
J. Dunlap13-Jul-03 22:06
J. Dunlap13-Jul-03 22:06 
GeneralRe: Changing the Form's title text Pin
eggie513-Jul-03 22:08
eggie513-Jul-03 22:08 
GeneralRe: Changing the Form's title text Pin
Rocky Moore13-Jul-03 22:10
Rocky Moore13-Jul-03 22:10 
GeneralRe: Changing the Form's title text Pin
Rocky Moore13-Jul-03 22:11
Rocky Moore13-Jul-03 22:11 
GeneralRe: Changing the Form's title text Pin
eggie513-Jul-03 22:14
eggie513-Jul-03 22:14 
QuestionCan one thread see that the other one's dead? Pin
Bog13-Jul-03 19:46
Bog13-Jul-03 19:46 
I have two theads in my windows app- the main GUI thread, and a constantly listening worker which runs an infinite while(true) loop.

The problem is, when I quit the app, the worker thread keeps running and sucks up 100% CPU time. So, I have the main gui thread set a bool variable to false when the app's window closes, and then in the loop for the worker, it listens for that and kills itself when it sees that the bool is false.

That's all fine, but my fear is what if the main window of the app gets blown up, and it's "window closing" event never fires? Like, if the main window is closed because it throws some low level error or something. I've seen it happen already.

In that case, the worker thread would never get the signal to die. Is there some other way to make the worker check on the existence of the gui thread?

thanks



"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx

AnswerRe: Can one thread see that the other one's dead? Pin
Richard Deeming14-Jul-03 2:05
mveRichard Deeming14-Jul-03 2:05 
GeneralRe: Can one thread see that the other one's dead? Pin
Bog14-Jul-03 8:54
Bog14-Jul-03 8:54 
GeneralChanging a button Pin
eggie513-Jul-03 18:13
eggie513-Jul-03 18:13 
GeneralRe: Changing a button Pin
Nick Parker13-Jul-03 19:04
protectorNick Parker13-Jul-03 19:04 
GeneralRe: Changing a button Pin
eggie513-Jul-03 19:44
eggie513-Jul-03 19:44 
GeneralGraying out a button Pin
eggie513-Jul-03 16:08
eggie513-Jul-03 16:08 
GeneralRe: Graying out a button Pin
Nick Seng13-Jul-03 16:30
Nick Seng13-Jul-03 16:30 
GeneralRe: Graying out a button Pin
eggie513-Jul-03 16:37
eggie513-Jul-03 16:37 
GeneralRe: Graying out a button Pin
Nick Seng13-Jul-03 17:06
Nick Seng13-Jul-03 17:06 
Generalrich edit component Pin
peterchen13-Jul-03 8:44
peterchen13-Jul-03 8:44 
GeneralRe: rich edit component Pin
apferreira13-Jul-03 8:47
apferreira13-Jul-03 8:47 
GeneralRe: rich edit component Pin
Nick Parker13-Jul-03 8:49
protectorNick Parker13-Jul-03 8:49 
GeneralRe: rich edit component Pin
apferreira13-Jul-03 8:51
apferreira13-Jul-03 8:51 
GeneralRe: rich edit component Pin
J. Dunlap13-Jul-03 8:55
J. Dunlap13-Jul-03 8:55 
GeneralRe: rich edit component Pin
Nick Parker13-Jul-03 9:01
protectorNick Parker13-Jul-03 9:01 
GeneralRe: rich edit component Pin
Nick Parker13-Jul-03 9:00
protectorNick Parker13-Jul-03 9:00 
GeneralRe: rich edit component Pin
apferreira13-Jul-03 9:04
apferreira13-Jul-03 9:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.