I am trying to close the appliaction some how when another thread finishes. I am using c#. code below is just an example
class main
{
constuctor
{
thread t = new thread(open loading screen);
}
public void open loading screen()
{
if (error)
exit program
application.exit(); // doesn't work
this.Close; // doesn't work
thread.abort or mainform.abort doesnt work.
}
}
if i call a function on the main with application.exit this doesnt work because the call is made from another thread.
so how do I exit the program??
thanks in advance