コード例 #1
0
        /// <summary>
        ///  Pause remote functions by unhooking the keys and closing the serial port
        /// </summary>
        public void pauseRemote()
        {
            volumeDown.unhook();
            volumeUp.unhook();
            power.unhook();
            input.unhook();

            serial.closeSerial();
        }
コード例 #2
0
        /// <summary>
        /// Started frm_Suchen
        /// </summary>
        private void Start()
        {
            frm_Suchen s = new frm_Suchen(this);

            s.Show();
            gkh.unhook();
            this.Hide();
            bIsStarted = true;
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: SweetCandyklf/osu-trainer
        private async void OsuRunningTimer_Tick(object sender, EventArgs e)
        {
            // check if osu!.exe is running
            var processes = Process.GetProcessesByName("osu!");

            if (processes.Length == 0)
            {
                gameLoaded = false;
            }
            else
            {
                if (gameLoaded == false) // @ posedge gameLoaded
                {
                    await Task.Run(() => Thread.Sleep(5000));

                    gameLoaded = true;
                }
                else if (gameLoaded == null)
                {
                    gameLoaded = true;
                }

                if (userSongsFolder == null || userSongsFolder == "")
                {
                    // Try to get osu songs folder
                    var osuExePath = processes[0].MainModule.FileName;
                    userSongsFolder = Path.Combine(Path.GetDirectoryName(osuExePath), "Songs");
                    Properties.Settings.Default.SongsFolder = userSongsFolder;
                    Properties.Settings.Default.Save();
                }
            }
            int intStatus = 0;

            osuReader.GetCurrentStatus(out intStatus);
            OsuMemoryStatus status = (OsuMemoryStatus)intStatus;

            if (status == OsuMemoryStatus.SongSelect || status == OsuMemoryStatus.MultiplayerRoom || status == OsuMemoryStatus.MultiplayerSongSelect)
            {
                mapSelectScreen = true;
            }
            else
            {
                mapSelectScreen = false;
            }

            if (mapSelectScreen && !hooked)
            {
                kbhook.hook();
                hooked = true;
            }
            if (!mapSelectScreen && hooked)
            {
                kbhook.unhook();
                hooked = false;
            }
        }
コード例 #4
0
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     try
     {
         KListener.unhook();
         m_Languages.Clear();
         PresentationTraceSources.DataBindingSource.Listeners.Clear();
     }catch (Exception ex)
     {
         Log.Write(ex);
     }
 }
コード例 #5
0
 private void hookBtn_Click(object sender, EventArgs e)
 {
     if (!hooked)
     {
         gkh.hook();
         hooked       = true;
         hookBtn.Text = "Unhook";
         Print("Successfully Hooked!");
     }
     else
     {
         gkh.unhook();
         hooked       = false;
         hookBtn.Text = "Hook";
         Print("Successfully Unhooked!");
     }
 }
コード例 #6
0
        private void gkh_KeyDown(object sender, KeyEventArgs e)
        {
            if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
            {
                if (e.KeyCode.ToString() == exitKey)
                {
                    this.FormClosing -= new System.Windows.Forms.FormClosingEventHandler(this.BSOD_FormClosing);
                    if (doCount && percent < 100)
                    {
                        workerThread.Abort();
                    }
                    gkh.unhook();
                    Cursor.Show();
                    this.Close();
                }
            }

            e.Handled = true;
        }
コード例 #7
0
        private void Stop_Work()
        {
            //unhook
            gkh.unhook();
            dispatcherTimer.Stop();

            Button_Stop.IsEnabled  = false;
            Button_Start.IsEnabled = true;

            ComboBox_RefreshControl.IsEnabled = true;
            ComboBox_RefreshTimeout.IsEnabled = true;

            menuItemStart.Enabled = true;
            menuItemStop.Enabled  = false;

            menuItemRefreshControl.Enabled = true;
            menuItemRefreshTime.Enabled    = true;

            notifyIcon.Text = "Status: Stopped";
        }
コード例 #8
0
 // Form Close
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     globalHook.unhook();
 }
コード例 #9
0
ファイル: Overlay.cs プロジェクト: kissggj123/UGame
 private void Overlay_FormClosing(object sender, FormClosingEventArgs e)
 {
     gkh.unhook();
 }
コード例 #10
0
 private void MainFrm_FormClosing(object sender, FormClosingEventArgs e)
 {
     gkh.unhook();
 }
コード例 #11
0
ファイル: Combination.cs プロジェクト: tech-chieftain/exhibit
 public void Stop()
 {
     _gkh.unhook();
 }
コード例 #12
0
        public CommandControl(Session currentsession, Computer currentcomputer, MainWindow main, globalKeyboardHook hook)
        {
            InitializeComponent();

            this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - (this.Width + 60), 60);

            mysession  = currentsession;
            mycomputer = currentcomputer;

            label_hour.Text   = currentsession.Hour.ToString("00");
            label_minute.Text = currentsession.Min.ToString("00");
            label_second.Text = currentsession.Sec.ToString("00");

            label_code_value.Text = currentsession.SessionCode;

            mainwind = main;
            hook.unhook();

            toolTip_setting.SetToolTip(pictureBox_setting, "Setting");
            toolTip_setting.SetToolTip(pictureBox_minimize, "Minimize");

            WqlEventQuery WQLquery = new WqlEventQuery("SELECT * FROM __InstanceOperationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_PrintJob'");

            eventWatcher = new ManagementEventWatcher(WQLquery);
            eventWatcher.EventArrived += eventWatcher_EventArrived;
            eventWatcher.Start();

            //FileSystemWatcher fwatcher = new FileSystemWatcher();
            //fwatcher.Path = MiscClass.GetConfigValue("LogPath");

            //fwatcher.NotifyFilter =  NotifyFilters.LastWrite | NotifyFilters.FileName;

            //fwatcher.Changed += fwatcher_Changed;
            //fwatcher.Created += fwatcher_Created;

            //fwatcher.Filter = "*.csv";
            //fwatcher.EnableRaisingEvents = true;


            NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged;


            ismonitoringable = main.is_monitorable_public;

            dtdata = new DataTable();
            dtdata.Columns.Add("Time", typeof(DateTime));
            dtdata.Columns.Add("User", typeof(string));
            dtdata.Columns.Add("Pages", typeof(int));
            dtdata.Columns.Add("Copies", typeof(int));
            dtdata.Columns.Add("Printer", typeof(string));
            dtdata.Columns.Add("DocumentName", typeof(string));
            dtdata.Columns.Add("Client", typeof(string));
            dtdata.Columns.Add("PaperSize", typeof(string));
            dtdata.Columns.Add("Language", typeof(string));
            dtdata.Columns.Add("Height", typeof(string));
            dtdata.Columns.Add("Width", typeof(string));
            dtdata.Columns.Add("Duplex", typeof(string));
            dtdata.Columns.Add("Grayscale", typeof(string));
            dtdata.Columns.Add("Size", typeof(string));

            pagescount = currentsession.PagesPrinted.ToString();

            latestlogintime = Session.GetLatestLoginTime(currentcomputer.Id, currentsession.Id);

            this.Focus();
        }