private void MainClass_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; } else { try { WindowsShell.UnregisterHotKey(this); } catch {} return; } Hide(); }
private void exitItem_Click(object sender, EventArgs e) { WindowsShell.UnregisterHotKey(this); Application.Exit(); }
private void MainClass_Load(object sender, EventArgs e) { const Keys k = Keys.R | Keys.Control | Keys.Alt | Keys.Shift; WindowsShell.RegisterHotKey(this, k); }