Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Detect Open Instance and Show It
Pisi Can
Jul 12 2016 4:46 AM
275
Reply
Hi all!
I can check if the application is already running and show a message box that says "The app is already open, please double click on the system tray icon to show it". What I want is that when the user try to open the app again it shows the opened instance. How can I do that?
I check if the app is already open by the below codes:
string ProsesAdi = Process.GetCurrentProcess().ProcessName;
Process[] sonuc = Process.GetProcessesByName(ProsesAdi);
if (sonuc.Length > 1)
{
MessageBox.Show("Uygulama zaten açik. Sistem tepsisindeki simgeye çift tiklayin.", "Bilgi");
System.Environment.Exit(0);
}
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Data get in panel content
PDF file convert to MDB