예제 #1
0
        private void exitMenuItem_Click(object sender, EventArgs e)
        {
            if (_iomh != null)
            {
                _iomh.StopMonitor();
            }

            Application.Exit();
        }
예제 #2
0
        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.WindowsShutDown || e.CloseReason == CloseReason.TaskManagerClosing)
            {
                closedFromMenu = true;
            }

            if (closedFromMenu == false)
            {
                WindowState   = FormWindowState.Minimized;
                ShowInTaskbar = false;
                e.Cancel      = true;
            }
            else
            {
                if (iomh != null)
                {
                    iomh.StopMonitor();
                }
            }
        }