コード例 #1
0
        private void TrayClickTimer_Interval(object sender, EventArgs e)
        {
            if (_trayClickCount == 1)
            {
                _trayClickCount = 0;
                _trayClickTimer.Stop();

                TaskHandler.ExecuteTask(SettingsManager.MainFormSettings.On_Tray_Left_Click);
            }
        }
コード例 #2
0
        /// <summary>
        /// MouseEvent
        /// </summary>
        /// <param name="m"></param>
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case 0x84:
                base.WndProc(ref m);
                if ((int)m.Result == 0x1)
                {
                    m.Result = (IntPtr)0x2;
                }
                return;
            }
            base.WndProc(ref m);

            if (m.Msg == 0x0312 && m.WParam.ToInt32() == MYACTION_HOTKEY_ID)
            {
                if (running == false)
                {
                    running         = true;
                    OnOff.BackColor = Color.FromArgb(0, 192, 0);
                    TIMER.Start();
                    //Go to AcceptQ
                    MoveCursor(new Point(960, 718));
                }
                else
                {
                    running         = false;
                    OnOff.BackColor = Color.FromArgb(192, 0, 0);
                    TIMER.Stop();
                }
            }
            base.WndProc(ref m);
        }
コード例 #3
0
        private void ImageDisplay_ImageChanged()
        {
            tbImageDimensionsDisplay.Text = "";

            if (imageDisplay1.Image == null)
            {
                return;
            }

            _imageLoadFailedTimer.Stop();
            _imageLoadFailedTimer.Start();
            tbImageDimensionsDisplay.Text = string.Format("{0} x {1} : {2}%",
                                                          imageDisplay1.Image.Width,
                                                          imageDisplay1.Image.Height,
                                                          imageDisplay1.ZoomPercent);
        }
コード例 #4
0
 private void _ListviewRefreshTimer_Tick(object sender, EventArgs e)
 {
     ListView_.VirtualListSize += changeVirtualSizeBy;
     changeVirtualSizeBy        = 0;
     ForceListviewRedraw();
     _ListviewRefreshTimer.Stop();
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: RoadJDK/Twitch-Jambot
        /// <summary>
        /// MouseEvent
        /// </summary>
        /// <param name="m"></param>
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case 0x84:
                base.WndProc(ref m);
                if ((int)m.Result == 0x1)
                {
                    m.Result = (IntPtr)0x2;
                }
                return;
            }
            base.WndProc(ref m);

            if (m.Msg == 0x0312 && m.WParam.ToInt32() == MYACTION_HOTKEY_ID)
            {
                if (running == false)
                {
                    running         = true;
                    OnOff.BackColor = Color.FromArgb(0, 192, 0);
                    Jams            = JAM.Text.Split(',').ToList();
                    Delay           = DelayCount.Value;
                    TIMER.Interval  = Convert.ToInt32(Delay * 1000);///s to ms
                    TIMER.Start();
                }
                else
                {
                    running         = false;
                    OnOff.BackColor = Color.FromArgb(192, 0, 0);
                    TIMER.Stop();
                }
            }
            base.WndProc(ref m);
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: perrenialprick/XAPSpy
        private void TIMER_Tick(object sender, EventArgs e)
        {
            TIMER.Stop();
            Regex        regx1 = new Regex("(\\*Type:)(?<type>.+) (method name:)(?<method>.+)");
            Regex        regx2 = new Regex("(\\*Param Name:)(?<varname>[\\w\\W]*)");
            Regex        regx3 = new Regex("(?<var>[\\w\\W]*)");
            ListViewItem item  = null;

            bool isDumpingVars = false;
            int  i             = 0;

            try
            {
                listViewXDE.BeginUpdate();
                lock (monitorQueue)
                {
                    string strTmp = "";
                    while (monitorQueue.Count > 0)
                    {
                        i++;
                        MonitorEntry entry = monitorQueue.Dequeue();

                        if (regx1.IsMatch(entry.writeBuffer))   //beginning of method dump
                        {
                            if (isDumpingVars && item != null)
                            {
                                item.SubItems.Add(strTmp);
                                isDumpingVars = false;  //close previous method dump
                                strTmp        = "";
                                listViewXDE.Items[listViewXDE.Items.Count - 1].EnsureVisible();
                            }
                            Match m1 = regx1.Match(entry.writeBuffer);
                            item = listViewXDE.Items.Add(entry.timeStamp.ToLongTimeString());
                            string strType = m1.Groups["type"].ToString();
                            item.SubItems.Add(strType);
                            string strMethodName = m1.Groups["method"].ToString();
                            item.SubItems.Add(strMethodName);
                        }
                        else if (regx2.IsMatch(entry.writeBuffer))  //beginning of var name
                        {
                            Match m2 = regx2.Match(entry.writeBuffer);
                            strTmp       += m2.Groups["varname"].ToString().Replace("\r\n", "").Replace("\r", "") + ":";
                            isDumpingVars = true;
                        }
                        else if (isDumpingVars)
                        {
                            Match m3 = regx3.Match(entry.writeBuffer);
                            strTmp += m3.Groups["var"].ToString();
                        }
                    }
                    listViewXDE.EndUpdate();
                }
            }
            finally
            {
                TIMER.Start();
            }
        }
コード例 #7
0
        /// <summary>
        /// Loads the selected item in the listview
        /// </summary>
        public void LoadSelectedImage()
        {
            _loadImageTimer.Stop();

            if (folderView1.SelectedIndex == -1)
            {
                return;
            }

            if (!(folderView1.ListView_.Items[folderView1.SelectedIndex].Tag is FileInfo))
            {
                return;
            }

            FileInfo f = folderView1.ListView_.Items[folderView1.SelectedIndex].Tag as FileInfo;

            if (!File.Exists(f.FullName))
            {
                return;
            }

            if (imageDisplay1.ImagePath != null && f.FullName == imageDisplay1.ImagePath.FullName)
            {
                return;
            }

            if (_loadImageThread != null)
            {
                if (_loadImageThread.Status == TaskStatus.Running ||
                    _loadImageThread.Status == TaskStatus.WaitingForActivation)
                {
                    return;
                }
            }

            _loadImageThread?.Dispose();
            _loadImageThread = imageDisplay1.TryLoadImageAsync(f.FullName);
        }
コード例 #8
0
 private void EndOfGame()
 {
     TIMER.Stop();
     Win           = new TextBox();
     Win.Enabled   = false;;
     Win.Multiline = true; Win.Height = this.Height; Win.Width = this.Width;
     Win.BackColor = this.ForeColor = Color.Aqua; Win.BorderStyle = BorderStyle.None;
     VisibleData(false);
     Win.Parent = pictureBox1;
     gBuff.Graphics.FillRectangle(sb, new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height));
     Win.Location = new System.Drawing.Point(pictureBox1.Width / 3, pictureBox1.Height / 3);
     Win.Text     = "Игра окончена!\r\nРезультат:" + (plus - minus).ToString();
     Win.Font     = new Font("Microsoft Sans Serif", 24, FontStyle.Bold);
     Controls.Add(Win);
 }
コード例 #9
0
        private void TIMER_Tick(object sender, EventArgs e)
        {
            var pixel = GetColorAt(new Point(765, 190));

            DoMouseClick();

            if (pixel.R == 0 && pixel.G == 0 && pixel.B == 0)
            {
                TIMER.Stop();
                running        = false;
                this.BackColor = Color.Maroon;
                Thread.Sleep(300);
                Run();
            }
        }
コード例 #10
0
ファイル: Form1.cs プロジェクト: perrenialprick/XAPSpy
        private void btnStop_Click(object sender, EventArgs e)
        {
            switch (isMonitoring)
            {
            case false:
                TIMER.Start();
                isMonitoring = true;
                btnStop.Text = "Stop";
                break;

            case true:
                TIMER.Stop();
                isMonitoring = false;
                btnStop.Text = "Start";
                break;
            }
        }
コード例 #11
0
        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.A)
            {
                cue.Expand(0.1);
            }
            if (e.KeyCode == Keys.D)
            {
                cue.Expand(-0.1);
            }
            if (e.KeyCode == Keys.C)
            {
                cue.ChangeOwner(NextBall(cue.Owner.Numb));
            }
            if (e.KeyCode == Keys.F)
            {
                if (HitMode)
                {
                    DoHit(); HitMode = false;
                }
                else
                {
                    bo        = new BallOut("Шары не остановились");
                    shtr.Text = shtr.Text.Replace(minus.ToString(), (minus + 50).ToString()); minus += 50;
                    bo.Owner  = this;
                    bo.Show();
                }
            }
            if (e.KeyCode == Keys.L)
            {
                EndOfGame();
            }
            if (e.KeyCode == Keys.Escape)
            {
                TIMER.Stop();

                Menu m = new Menu(pictureBox1.Image); m.Owner = this;
                m.ShowDialog();
                if (m.DialogResult == DialogResult.Cancel)
                {
                    this.Close();
                }
                if (m.DialogResult == DialogResult.Retry)
                {
                    VisibleData(true); StartingPosition(); HitMode = true;
                }

                TIMER.Start();
            }

            if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Right)
            {
                if (TimeSpeed < 5)
                {
                    timelabel.Text = timelabel.Text.Replace((char)(TimeSpeed + 48), (char)(TimeSpeed * 2 + 48)); TimeSpeed *= 2;
                }
            }
            if (e.KeyCode == Keys.Down || e.KeyCode == Keys.Left)
            {
                if (TimeSpeed > 1)
                {
                    timelabel.Text = timelabel.Text.Replace((char)(TimeSpeed + 48), (char)(TimeSpeed / 2 + 48)); TimeSpeed /= 2;
                }
            }
        }
コード例 #12
0
        private void TIMER_Tick(object sender, EventArgs e)
        {
            TIMER.Stop();

            try
            {
                /*
                 * Add new monitoring entries...
                 */
                LIST_Accesses.BeginUpdate();

                lock (MonitorQueue)
                {
                    while (MonitorQueue.Count > 0)
                    {
                        MonitorEntry Entry = MonitorQueue.Dequeue();
                        ListViewItem Item  = LIST_Accesses.Items.Insert(0, Entry.ClientPID.ToString());

                        Item.SubItems.Add(Entry.Timestamp.ToString("hh:mm:ss." + ((Entry.Timestamp.Ticks / 10000) % 1000).ToString()));
                        Item.SubItems.Add(Entry.Access);
                    }
                }

                LIST_Accesses.EndUpdate();

                /*
                 * Update internal process list...
                 */
                lock (ProcessList)
                {
                    Boolean HasChanged = false;

                    if (ProcessList.Count == LIST_Processes.Items.Count)
                    {
                        for (int i = 0; i < ProcessList.Count; i++)
                        {
                            if (ProcessList[i].Id != Int32.Parse(LIST_Processes.Items[i].SubItems[1].Text))
                            {
                                HasChanged = true;

                                break;
                            }
                        }
                    }
                    else
                    {
                        HasChanged = true;
                    }

                    if (HasChanged)
                    {
                        Int32 SelIndex = 0;

                        if (LIST_Processes.SelectedIndices.Count > 0)
                        {
                            SelIndex = LIST_Processes.SelectedIndices[0];
                        }

                        LIST_Processes.BeginUpdate();
                        LIST_Processes.Items.Clear();

                        for (int i = 0; i < ProcessList.Count; i++)
                        {
                            ProcessInfo  Proc = ProcessList[i];
                            ListViewItem Item = LIST_Processes.Items.Add("");

                            Item.SubItems.Add(Proc.Id.ToString());

                            if (Proc.Is64Bit)
                            {
                                Item.SubItems.Add("x64");
                            }
                            else
                            {
                                Item.SubItems.Add("x86");
                            }

                            Item.SubItems.Add(System.IO.Path.GetFileName(Proc.FileName));
                            Item.SubItems.Add(Proc.User);
                            Item.SubItems.Add(Proc.FileName);

                            Item.Checked = HookedProcesses.Contains(Proc.Id);
                        }

                        if (SelIndex >= LIST_Processes.Items.Count)
                        {
                            SelIndex = LIST_Processes.Items.Count - 1;
                        }

                        LIST_Processes.Items[SelIndex].Selected = true;
                        LIST_Processes.Items[SelIndex].EnsureVisible();

                        LIST_Processes.EndUpdate();
                    }


                    /*
                     * Update list of hooked processes...
                     */
                    for (int i = 0; i < HookedProcesses.Count; i++)
                    {
                        if (!ActivePIDList.Contains(HookedProcesses[i]))
                        {
                            HookedProcesses.RemoveAt(i--);
                        }
                    }
                }
            }
            finally
            {
                TIMER.Start();
            }
        }