I have 2 form : MainFrm is main form and Notification is form used to show notification.
In program.cs :
- static void Main()
- {
- bool result;
- Mutex mutex = new Mutex(true, "UniqueAppId", out result);
- if (!result)
- {
- //MainFrm.showNotification("KyAppAPI??????????");
- //MessageBox.Show("KyAppAPI??????????");
- Notification notiBox = new Notification();
- notiBox.Show();
- return;
- }
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainFrm());
GC.KeepAlive(mutex);
}
[/CODE]I use mutex to keep application run once. If application already running, form Notification will show.
But my code work not right, form Notification not shown.
In MainFrm, I has a static method showNotification (using Tulpep Notification). I try calling this method in static main, but it not working, too.
However, if I use MessageBox, it working fine.
I don't know where the problem is. Please help me.
Salman BegPosted Feb 12, 2019, 10:17 AM
Thang LePosted Feb 12, 2019, 12:25 AM
I 'm a newbie C# so I don't know how debug in Visual Studio.
Salman BegPosted Feb 11, 2019, 10:43 PM