Ejemplo n.º 1
0
 private void HookManager_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     try
     {
         APPNAME   = DBase.ActiveApplicationName();
         this.Text = "DBC - " + APPNAME;
         DataTable dtf = DBase.FilterTable(DBase.DTAPP, "APPNAME = '" + APPNAME + "'");
         if (dtf.Rows.Count > 0)
         {
             ENABLE = DBase.BoolReturn(dtf, 0, "ENABLE");
             if (ENABLE)
             {
                 DOUBLECLICK        = DBase.BoolReturn(dtf, 0, "DOUBLECLICK");
                 HOLDCLICK          = DBase.BoolReturn(dtf, 0, "HOLDCLICK");
                 SHORTKEY           = DBase.StringReturn(dtf, 0, "SHORTKEY");
                 SKIP_OLD_CLIPBOARD = DBase.BoolReturn(dtf, 0, "SKIP_OLD_CLIPBOARD");
                 if (DOUBLECLICK)
                 {
                     if (APPNAME.ToLower() == "firefox" || APPNAME.ToLower() == "chrome" || APPNAME.ToLower() == "steam" || APPNAME.ToLower() == "opera")
                     {
                         if ((Cursor.Position.Y - DBase.HandleLocation_Top) > 150)
                         {
                             TRANSLATE(true);
                         }
                     }
                     else
                     {
                         TRANSLATE(true);
                     }
                 }
                 else
                 {
                     this.Text = "DBC - " + APPNAME + " - DISABLED - " + SHORTKEY;
                 }
             }
             else
             {
             }
         }
     }
     catch (Exception ex)
     {
         if (DBase.ShowException == 1)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }
Ejemplo n.º 2
0
        private void HookManager_KeyDown(object sender, KeyEventArgs e)
        {
            if (DBase.ActiveTranslation == 0)
            {
                return;
            }
            try
            {
                APPNAME = DBase.ActiveApplicationName();
                dtf     = DBase.FilterTable(DBase.DTAPP, "APPNAME = '" + APPNAME + "'");
                if (dtf.Rows.Count > 0)
                {
                    ENABLE             = DBase.BoolReturn(dtf, 0, "ENABLE");
                    SKIP_OLD_CLIPBOARD = DBase.BoolReturn(dtf, 0, "SKIP_OLD_CLIPBOARD");
                    if (ENABLE)
                    {
                        SHORTKEY = DBase.StringReturn(dtf, 0, "SHORTKEY");
                        Enum.TryParse(SHORTKEY, out key);
                        if (e.KeyCode == key)
                        {
                            TRANSLATE(false);
                        }
                        else
                        {
                            this.Text = "KD - " + APPNAME + " - " + SHORTKEY;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (DBase.ShowException == 1)
                {
                    MessageBox.Show(ex.ToString());
                }
            }

            //Enable/Disable
            if (DWindow.IsControlKeyDown() && DWindow.IsAltKeyDown() && DWindow.IsShiftKeyDown())
            {
                if ((DateTime.Now - LastKeyPress).TotalMilliseconds > 1000)
                {
                    LastKeyPress            = DateTime.Now;
                    DBase.ActiveTranslation = DBase.ActiveTranslation == 1 ? 0 : 1;
                    RefreshButton();
                }
            }
        }
Ejemplo n.º 3
0
        private void BGLoading(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            Process[] PList = Process.GetProcesses();
            DataTable dt2   = DWindow.UseWMIToGetProcesses();

            dt.Clear();
            try
            {
                foreach (Process p in PList)
                {
                    if (p.MainWindowTitle.Length <= 0)
                    {
                        continue;
                    }
                    string    username    = p.StartInfo.EnvironmentVariables["username"].ToString();
                    string    processname = p.ProcessName;
                    Icon      I           = null;
                    DataTable dtf         = DBase.FilterTable(dt2, "ProcessId = '" + p.Id + "'");
                    if (dtf.Rows.Count > 0)
                    {
                        try
                        {
                            string  PATH = DBase.StringReturn(dtf, 0, "ExecutablePath");
                            DataRow dr   = dt.NewRow();
                            dr["PATH"]    = PATH;
                            I             = Icon.ExtractAssociatedIcon(PATH);
                            dr["ICON"]    = I.ToBitmap();
                            dr["APPNAME"] = processname;
                            dt.Rows.Add(dr);
                        }
                        catch (Exception) { }
                    }
                }

                dt = DBase.SortTable(dt, "APPNAME");
            }
            catch (Exception) { }
            finally
            {
            }
        } //Action
Ejemplo n.º 4
0
 private void dgv_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         string COL = dgv.Columns[e.ColumnIndex].DataPropertyName;
         if (COL == "ICON")
         {
             string ID = DBase.StringReturn(dgv.SelectedRows[0].Cells["COLID"].Value);
             DHuy.RUN_SQL("DELETE WEBBOOK WHERE ID = " + ID + "");
             temp            = DBase.FilterTable(temp, "ID <> " + ID);
             DBase.DTADDRESS = DBase.FilterTable(DBase.DTADDRESS, "ID <> " + ID);
         }
         else
         {
             res = DBase.StringReturn(dgv.SelectedRows[0].Cells["COLURL"].Value);
             dgv.Focus();
             Visible = false;
             //Z.AcceptInput(res, T);
         }
     }
     catch (Exception) { };
 }
Ejemplo n.º 5
0
        void HookManager_MouseUp(object sender, MouseEventArgs e)
        {
            if (DBase.ActiveTranslation == 0)
            {
                return;
            }

            try
            {
                if ((DateTime.Now - MDown).TotalMilliseconds >= 2000)
                {
                    APPNAME  = DBase.ActiveApplicationName();
                    SHORTKEY = DBase.StringReturn(dtf, 0, "SHORTKEY");
                    P2       = new Point(Cursor.Position.X, Cursor.Position.Y);

                    this.Text = APPNAME + " - " + DBase.HandleLocation_Top + " - " + (Cursor.Position.Y - DBase.HandleLocation_Top);
                    dtf       = DBase.FilterTable(DBase.DTAPP, "APPNAME = '" + APPNAME + "'");
                    if (dtf.Rows.Count > 0)
                    {
                        ENABLE = DBase.BoolReturn(dtf, 0, "ENABLE");
                        if (ENABLE)
                        {
                            DOUBLECLICK        = DBase.BoolReturn(dtf, 0, "DOUBLECLICK");
                            HOLDCLICK          = DBase.BoolReturn(dtf, 0, "HOLDCLICK");
                            SHORTKEY           = DBase.StringReturn(dtf, 0, "SHORTKEY");
                            SKIP_OLD_CLIPBOARD = DBase.BoolReturn(dtf, 0, "SKIP_OLD_CLIPBOARD");
                            if (HOLDCLICK)
                            {
                                if (Cursor.Position.X < X)
                                {
                                    X = Cursor.Position.X;
                                }
                                if (Cursor.Position.Y < Y)
                                {
                                    Y = Cursor.Position.Y;
                                }

                                if (APPNAME.ToLower() == "firefox" || APPNAME.ToLower() == "chrome" || APPNAME.ToLower() == "steam" || APPNAME.ToLower() == "opera")
                                {
                                    if (Cursor.Position.Y > 150)
                                    {
                                        TRANSLATE(true);
                                    }
                                    else
                                    {
                                        //this.Text = DateTime.Now.ToString("hh:ss");
                                    }
                                }
                                else
                                {
                                    TRANSLATE(true);
                                }
                            }
                            else
                            {
                                this.Text = "HC - " + APPNAME + " - DISABLED - " + SHORTKEY + "  ";
                            }
                        }
                    }
                }
                else
                {
                    //this.Text = "JustClickSee";
                }
            }
            catch (Exception ex) {
                if (DBase.ShowException == 1)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }