Beispiel #1
0
 // Token: 0x06000066 RID: 102 RVA: 0x00002C08 File Offset: 0x00000E08
 private static void EnsureSubscribedToGlobalMouseEvents()
 {
     if (HookManager.s_MouseHookHandle == 0)
     {
         HookManager.s_MouseDelegate   = new HookManager.HookProc(HookManager.MouseHookProc);
         HookManager.s_MouseHookHandle = HookManager.SetWindowsHookEx(14, HookManager.s_MouseDelegate, Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0);
         if (HookManager.s_MouseHookHandle == 0)
         {
             throw new Win32Exception(Marshal.GetLastWin32Error());
         }
     }
 }
Beispiel #2
0
 // Token: 0x06000065 RID: 101 RVA: 0x00002BA4 File Offset: 0x00000DA4
 private static void EnsureSubscribedToGlobalKeyboardEvents()
 {
     if (HookManager.s_KeyboardHookHandle == 0)
     {
         HookManager.s_KeyboardDelegate   = new HookManager.HookProc(HookManager.KeyboardHookProc);
         HookManager.s_KeyboardHookHandle = HookManager.SetWindowsHookEx(13, HookManager.s_KeyboardDelegate, IntPtr.Zero, 0);
         if (HookManager.s_KeyboardHookHandle == 0)
         {
             throw new Win32Exception(Marshal.GetLastWin32Error());
         }
     }
 }
 private static void EnsureSubscribedToGlobalKeyboardEvents()
 {
     if (HookManager.s_KeyboardHookHandle != 0)
     {
         return;
     }
     HookManager.s_KeyboardDelegate   = new HookManager.HookProc(HookManager.KeyboardHookProc);
     HookManager.s_KeyboardHookHandle = HookManager.SetWindowsHookEx(13, HookManager.s_KeyboardDelegate, Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0);
     if (HookManager.s_KeyboardHookHandle == 0)
     {
         throw new Win32Exception(Marshal.GetLastWin32Error());
     }
 }
Beispiel #4
0
 private static void EnsureSubscribedToGlobalKeyboardEvents()
 {
     if (HookManager.s_KeyboardHookHandle == 0)
     {
         HookManager.s_KeyboardDelegate = new HookManager.HookProc(HookManager.KeyboardHookProc);
         Process       currentProcess = Process.GetCurrentProcess();
         ProcessModule mainModule     = currentProcess.MainModule;
         IntPtr        moduleHandle   = HookManager.GetModuleHandle(mainModule.ModuleName);
         HookManager.s_KeyboardHookHandle = HookManager.SetWindowsHookEx(13, HookManager.s_KeyboardDelegate, moduleHandle, 0);
         if (HookManager.s_KeyboardHookHandle == 0)
         {
             int lastWin32Error = Marshal.GetLastWin32Error();
         }
     }
 }