Visual Studio 2012, windows 양식을 사용하여 바탕 화면의 바로 가기를 클릭하십시오. 나는 바탕 화면에서 바로 가기를 클릭하면 시스템 트레이에서 응용 프로그램을 복원해야합니다.시스템 트레이에서 프로그램 복원 C#
동일한 응용 프로그램의 이중성을 방지하지만 시스템 트레이의 응용 프로그램을 열지 못하도록하는 코드입니다.
[STAThread]
static void Main()
{
string mutex_id = "my application";
using (Mutex mutex = new Mutex(false, mutex_id))
{
if (!mutex.WaitOne(0, false))
{
Form1 fForm;
fForm = new Form1();
fForm.Show();
fForm.WindowState = FormWindowState.Normal;
fForm.ShowInTaskbar = true;
// MessageBox.Show("Instance Already Running!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
몇 가지 질문은 여기 stackoverflow에서 행운을 빕니다. 이 코드에서 수정해야하는 것은 무엇입니까? 미리 감사드립니다!
이 질문에 대한 답변을 생각합니다 : http://stackoverflow.com/questions/4592852/restoring-window-from-the-system-tray-when-allowing-only-one-instance-of- that-pr – FrostyFire
http://stackoverflow.com/a/14326291/17034 –