I would like to ask anyone of you if you have tried this kind of scenario. I developed a windows application in c#. In main Program (Program.cs) I added a thread mutex just to multitask many operations executed under it.
//under Program.cs
public static FormOneInstance frmOneInstance;
static void Main()
{
t = new Thread(new ThreadStart(CreateInputOutput));
t.Start();
}
public static void CreateInputOutput()
{
try
{
mutex.WaitOne();
ExecuteManyOperationsHere();
}
finally
{
mutex.ReleaseMutex();
Thread.CurrentThread.Abort(); //Has ThreadAbortException here
t = null;
}
}
public static void ExecuteManyOperationsHere()
{
frmOneInstance =new FormOneInstance (); //this has lot of execution on formLoad that includes ShowSummary()
}
And on my other Form FormOneInstance class, I used System.Windows.Forms Timer
private void timer1_Tick(object sender, EventArgs e)
{
ShowSummary();
}
Now, I want to separate the thread in main and UI. Thanks!