Code:
using System;
using SpecialServices;
namespace MyNameSpace
{
public class MyForm : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
public MyForm()
{
InitializeComponent();
...
}
[STAThread]
static void Main()
{
using(SingleProgramInstance spi = new SingleProgramInstance("MyForm"))
{
if (spi.IsSingleInstance)
{
try
{
Application.Run(new MyForm());
}
catch (Exception e)
{
...
}
Application.ExitThread();
}
else
{
MessageBox.Show("Bla, bla", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
...
}
Poenta je, očigledno u main funkciji.
Sad ću da okačim i dll
OTPOR blokadi ulica, OTPOR blokiranom Beogradu, OTPOR blokiranoj Srbiji