Пример #1
0
        private void NiTrayIcon_MouseClick1Up(object sender, MouseEventArgs e)
        {
            switch (e.Button)
            {
            case MouseButtons.Left:
                _trayClickCount++;

                if (_trayClickCount == 1)
                {
                    _trayClickTimer.Start();
                }
                else
                {
                    _trayClickCount = 0;
                    _trayClickTimer.Stop();

                    TaskHandler.ExecuteTask(SettingsManager.MainFormSettings.On_Tray_Double_Click);
                }
                break;

            case MouseButtons.Middle:
                TaskHandler.ExecuteTask(SettingsManager.MainFormSettings.On_Tray_Middle_Click);
                break;
            }
        }
Пример #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
        /// <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);
        }
Пример #5
0
        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();
            }
        }
Пример #6
0
        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;
            }
        }
Пример #7
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Objects          = new List <Ball>();
            this.Size        = pictureBox1.Size;
            Plus.Location    = new System.Drawing.Point(Plus.Location.X, 5);
            shtr.Location    = new System.Drawing.Point(shtr.Location.X, 5);
            pictureBox1.Dock = DockStyle.Fill;
            CoordinatesDelta = new Point {
                X = this.Width / 2, Y = this.Height / 2
            };
            sb = new SolidBrush(this.BackColor);
            TIMER.Start();
            Ball.acceleration_koef = 0.005;
            Cue.MaxForce           = 5;
            StartingPosition();
            context = BufferedGraphicsManager.Current;
            context.MaximumBuffer = new Size(pictureBox1.Width + 1, pictureBox1.Height + 1);

            gBuff = context.Allocate(pictureBox1.CreateGraphics(), new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height));

            DrawToBuffer(gBuff.Graphics, TimeSpeed);
        }
Пример #8
0
 private void LvListView_ItemSelectionChanged(object sender, EventArgs e)
 {
     _loadImageTimer.Stop();
     _loadImageTimer.Start();
 }
Пример #9
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;
                }
            }
        }
Пример #10
0
 // really need to fix this cause its SUPER slow for a large amount of files
 // probably gonna just use a timer to redraw the listview after 500ms or smth
 private void _FolderWatcher_DirectoryAdded(string name)
 {
     changeVirtualSizeBy++;
     _ListviewRefreshTimer.Start();
 }
Пример #11
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();
            }
        }