public partial class Form1 : Form
{
[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn
(
int nLeftRect, // x-coordinate of upper-left corner
int nTopRect, // y-coordinate of upper-left corner
int nRightRect, // x-coordinate of lower-right corner
int nBottomRect, // y-coordinate of lower-right corner
int nWidthEllipse, // width of ellipse
int nHeightEllipse // height of ellipse
);
public Form1()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None;
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
}
}
serviceController.Status
?string service
static void StartupNextInstanceHandler(object sender, StartupNextInstanceEventArgs e)
{
SingleInstanceApplication sia = (SingleInstanceApplication)sender;
Form1 f = (Form1)sia.ApplicationContext.MainForm;
if (e.CommandLine.Count == 2)
{
string link = e.CommandLine[1];
if (f.CheckURL(link))
{
f.webBrowser1.Navigate(link);
}
}
}
SingleInstanceApplication sia = (SingleInstanceApplication)sender;
Form1 f = (Form1)sia.ApplicationContext.MainForm;