コード例 #1
0
        private void refreshTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            try
            {
                //Position changed (0,0 set if screensaver activated)
                if (_oldPosition != Cursor.Position && Cursor.Position != new Point(0, 0))
                {
                    _oldPosition = Cursor.Position;
                    MouseMoved.RaiseEvent(this, new EventArgs());
                }

                //Restart timer
                _refreshTimer.Start();
            }
            catch (Exception ex)
            {
                ExceptionOccured.RaiseEvent(this, new ExceptionEventArgs
                {
                    Methode = MethodBase.GetCurrentMethod(),
                    Error   = ex
                });
            }
        }