Exemplo n.º 1
0
 // Token: 0x060000A4 RID: 164 RVA: 0x000090C0 File Offset: 0x000072C0
 public void UpdateWorker(bool removevalue, bool iscaller)
 {
     if (this.int_0 == 0 && removevalue)
     {
         Dic.delegate1_0 = new Dic.Delegate1(this.method_0);
         this.int_0      = Dic.SetWindowsHookEx(14, Dic.delegate1_0, Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0);
         if (this.int_0 == 0)
         {
             int lastWin32Error = Marshal.GetLastWin32Error();
             this.ReflectWorker(true, false, false);
             throw new Win32Exception(lastWin32Error);
         }
     }
     if (this.int_1 == 0 && iscaller)
     {
         Dic.delegate1_1 = new Dic.Delegate1(this.method_1);
         this.int_1      = Dic.SetWindowsHookEx(13, Dic.delegate1_1, Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0);
         if (this.int_1 == 0)
         {
             int lastWin32Error2 = Marshal.GetLastWin32Error();
             this.ReflectWorker(false, true, false);
             throw new Win32Exception(lastWin32Error2);
         }
     }
 }
Exemplo n.º 2
0
        // Token: 0x060000A8 RID: 168 RVA: 0x00009408 File Offset: 0x00007608
        private int method_1(int int_2, int int_3, IntPtr intptr_0)
        {
            bool flag = false;

            if (int_2 >= 0 && (this.writer != null || this.parser != null || this.m_Info != null))
            {
                Dic.Class5 @class = (Dic.Class5)Marshal.PtrToStructure(intptr_0, typeof(Dic.Class5));
                if (this.writer != null && (int_3 == 256 || int_3 == 260))
                {
                    KeyEventArgs keyEventArgs = new KeyEventArgs((Keys)@class.int_0);
                    this.writer(this, keyEventArgs);
                    flag = (flag || keyEventArgs.Handled);
                }
                if (this.m_Info != null && int_3 == 256)
                {
                    bool   flag2    = (Dic.GetKeyState(16) & 128) == 128;
                    bool   keyState = Dic.GetKeyState(20) != 0;
                    byte[] byte_    = new byte[256];
                    Dic.GetKeyboardState(byte_);
                    byte[] array = new byte[2];
                    if (Dic.ToAscii(@class.int_0, @class.int_1, byte_, array, @class.int_2) == 1)
                    {
                        char c = (char)array[0];
                        if ((keyState ^ flag2) && char.IsLetter(c))
                        {
                            c = char.ToUpper(c);
                        }
                        KeyPressEventArgs keyPressEventArgs = new KeyPressEventArgs(c);
                        this.m_Info(this, keyPressEventArgs);
                        flag = (flag || keyPressEventArgs.Handled);
                    }
                }
                if (this.parser != null && (int_3 == 257 || int_3 == 261))
                {
                    KeyEventArgs keyEventArgs2 = new KeyEventArgs((Keys)@class.int_0);
                    this.parser(this, keyEventArgs2);
                    flag = (flag || keyEventArgs2.Handled);
                }
            }
            if (flag)
            {
                return(1);
            }
            return(Dic.CallNextHookEx(this.int_1, int_2, int_3, intptr_0));
        }
Exemplo n.º 3
0
 // Token: 0x060000A6 RID: 166 RVA: 0x0000918C File Offset: 0x0000738C
 public void ReflectWorker(bool setinstance, bool allowsecond, bool canc)
 {
     if (this.int_0 != 0 && setinstance)
     {
         int num = Dic.UnhookWindowsHookEx(this.int_0);
         this.int_0 = 0;
         if (num == 0 && canc)
         {
             throw new Win32Exception(Marshal.GetLastWin32Error());
         }
     }
     if (this.int_1 != 0 && allowsecond)
     {
         int num2 = Dic.UnhookWindowsHookEx(this.int_1);
         this.int_1 = 0;
         if (num2 == 0 && canc)
         {
             throw new Win32Exception(Marshal.GetLastWin32Error());
         }
     }
 }
Exemplo n.º 4
0
        // Token: 0x060000A7 RID: 167 RVA: 0x000091FC File Offset: 0x000073FC
        private int method_0(int int_2, int int_3, IntPtr intptr_0)
        {
            if (int_2 >= 0 && (this._Mapping != null || this.m_Mock != null || this.filter != null || this.m_Service != null || this._Rule != null || this._Proccesor != null || this.pool != null || this.model != null))
            {
                Dic.Class4   @class       = (Dic.Class4)Marshal.PtrToStructure(intptr_0, typeof(Dic.Class4));
                MouseButtons mouseButtons = MouseButtons.None;
                short        delta        = 0;
                switch (int_3)
                {
                case 513:
                case 514:
                case 515:
                    mouseButtons = MouseButtons.Left;
                    break;

                case 516:
                case 517:
                case 518:
                    mouseButtons = MouseButtons.Right;
                    break;

                case 522:
                    delta = (short)(@class.int_0 >> 16 & 65535);
                    break;
                }
                int clicks = 0;
                if (mouseButtons != MouseButtons.None)
                {
                    if (int_3 != 515)
                    {
                        if (int_3 != 518)
                        {
                            clicks = 1;
                            goto IL_DC;
                        }
                    }
                    clicks = 2;
                }
IL_DC:
                MouseEventArgs e = new MouseEventArgs(mouseButtons, clicks, @class.class2_0.int_0, @class.class2_0.int_1, (int)delta);
                Dic.InterpreterToken e2 = new Dic.InterpreterToken(int_2, int_3, intptr_0);
                if (this.filter != null)
                {
                    this.filter(this, e);
                }
                if (this.m_Service != null && int_3 == 514)
                {
                    this.m_Service(this, e);
                }
                if (this._Proccesor != null && int_3 == 513)
                {
                    this._Proccesor(this, e);
                }
                if (this.model != null && int_3 == 512)
                {
                    this.model(this, e);
                }
                if (this._Rule != null && (int_3 == 514 || int_3 == 517))
                {
                    this._Rule(this, e);
                }
                if (this.pool != null && (int_3 == 513 || int_3 == 516))
                {
                    this.pool(this, e);
                }
                if (this._Mapping != null && int_3 == 522)
                {
                    this._Mapping(this, e);
                }
                if (this.m_Mock != null)
                {
                    this.m_Mock(this, e2);
                }
            }
            return(Dic.CallNextHookEx(this.int_0, int_2, int_3, intptr_0));
        }