当前位置: 首页>>代码示例>>C#>>正文


C# LowLevelKeyboardProc类代码示例

本文整理汇总了C#中LowLevelKeyboardProc的典型用法代码示例。如果您正苦于以下问题:C# LowLevelKeyboardProc类的具体用法?C# LowLevelKeyboardProc怎么用?C# LowLevelKeyboardProc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LowLevelKeyboardProc类属于命名空间,在下文中一共展示了LowLevelKeyboardProc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Freezeform

        public Freezeform()
        {
            ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
            objKeyboardProcess = new LowLevelKeyboardProc(captureKey);
            ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);

            InitializeComponent();
        }
开发者ID:Jguer,项目名称:Timed-Commands,代码行数:8,代码来源:Freezeform.cs

示例2: frmRemote

        public frmRemote()
        {
            InitializeComponent();
            Text = "FreeRDC - " + HostID;
            bgMonitor = new BackgroundWorker() { WorkerSupportsCancellation = true };

            //Get Current Module
            ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
            //Assign callback function each time keyboard process
            objKeyboardProcess = new LowLevelKeyboardProc(CaptureKey);
            //Setting Hook of Keyboard Process for current module
            ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);
        }
开发者ID:darkguy2008,项目名称:FreeRDC,代码行数:13,代码来源:frmRemote.cs

示例3: SetHook

 private static IntPtr SetHook(LowLevelKeyboardProc proc)
 {
     using (Process curProcess = Process.GetCurrentProcess())
     using (ProcessModule curModule = curProcess.MainModule)
     {
         return SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
     }
 }
开发者ID:nvelozsavino,项目名称:ardrone,代码行数:8,代码来源:InterceptKeys.cs

示例4: AutoTyper

 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="autoTypedText">List of autotyped text</param>
 public AutoTyper(string[] autoTypedText)
 {
     for (int i = 0; i < Math.Min(autoTypedText.Length, this.AutoTypedText.Length); i++)
     {
         this.AutoTypedText[i] = autoTypedText[i];
     }
     _proc = new LowLevelKeyboardProc(HookCallback);
     _hookId = SetHook(_proc);
 }
开发者ID:nmariot,项目名称:AutoTyper,代码行数:13,代码来源:AutoTyper.cs

示例5: Hook

        public Hook(LowLevelKeyboardProc callback)
        {
            this._Callback = GCHandle.Alloc(callback);

            if ((this._Handle = NativeMethods.SetWindowsHookExW(NativeMethods.WH_KEYBOARD_LL, Marshal.GetFunctionPointerForDelegate(callback), NativeMethods.GetModuleHandle(), 0)) == IntPtr.Zero)
            {
                throw new Win32Exception();
            }
        }
开发者ID:Goletas,项目名称:screencapture,代码行数:9,代码来源:Hook.cs

示例6: MainWindow

        //*****************************************************************************************/
        /**
         * Constructor
         * */
        public MainWindow()
        {
            ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule; //Get Current Module
            objKeyboardProcess = new LowLevelKeyboardProc(captureKey); //Assign callback function each time keyboard process
            ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0); //Setting Hook of Keyboard Process for current module

            InitializeComponent();
            Init();
        }
开发者ID:anthonyhiga,项目名称:toddlertyper,代码行数:13,代码来源:window.cs

示例7: SetHook

 private static IntPtr SetHook(LowLevelKeyboardProc lowLevelKeyboardProc)
 {
     using (var currentProcess = Process.GetCurrentProcess())
     {
         using (var mainModule = currentProcess.MainModule)
         {
             return SetWindowsHookEx(WhKeyboardLl, lowLevelKeyboardProc, GetModuleHandle(mainModule.ModuleName), 0);
         }
     }
 }
开发者ID:jasemagee,项目名称:KeyLogger,代码行数:10,代码来源:Program.cs

示例8: SetHook

        public IntPtr SetHook(LowLevelKeyboardProc proc)
        {
            _addKey = AddKeyPress;

            using (var currentProcess = Process.GetCurrentProcess())
            using (var currentModule = currentProcess.MainModule)
            {
                return SetWindowsHookEx(WhKeyboardLl, proc,
                    GetModuleHandle(currentModule.ModuleName), 0);
            }
        }
开发者ID:MattBroyles,项目名称:CustomKeyboardLightingController,代码行数:11,代码来源:KeyboardHook.cs

示例9: SetHook

        public void SetHook(Action<int> hook)
        {
            if (Set)
            {
                return;
            }

            Hook = hook;
            Set = true;
            _proc = new LowLevelKeyboardProc(HookCallback);
            _hookID = SetHook(_proc);
        }
开发者ID:pJqEM5Kj,项目名称:stuff,代码行数:12,代码来源:KeyInterceptor.cs

示例10: ClioGUI

        public ClioGUI()
        {
            ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
            objKeyboardProcess = new LowLevelKeyboardProc(captureKey);
            ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);

            InitializeComponent();

            CheckForIllegalCrossThreadCalls = false;

            //this.TopMost = true;
        }
开发者ID:rxgranda,项目名称:ClientClio,代码行数:12,代码来源:ClioGUI.cs

示例11: BeginCapture

		public static void BeginCapture()
		{
			s_proc = new LowLevelKeyboardProc(HookProc);
			s_hook = SetWindowsHookEx(WH_KEYBOARD_LL,
					s_proc,
					GetModuleHandle(Process.GetCurrentProcess().MainModule.ModuleName),
					0);
			AppDomain.CurrentDomain.DomainUnload += delegate
			{
				if (s_hook != IntPtr.Zero)
					UnhookWindowsHookEx(s_hook);
			};
		}
开发者ID:kokeiro001,项目名称:AutoMinesweeperSolver,代码行数:13,代码来源:GlobalKeyboardCapture.cs

示例12: KeyboardHook

		private KeyboardHook(KeyboardShortcut shortcut, Action callback)
		{
			_shortcut = shortcut;
			_callback = callback;

			// ReSharper disable once RedundantDelegateCreation
			_proc = new LowLevelKeyboardProc(HookCallback);

			using (var curProcess = Process.GetCurrentProcess())
			{
				using (var curModule = curProcess.MainModule)
				{
					_hookID = SetWindowsHookEx(WH_KEYBOARD_LL, _proc, GetModuleHandle(curModule.ModuleName), 0);
				}
			}
		}
开发者ID:olivierdagenais,项目名称:GoToWindow,代码行数:16,代码来源:KeyboardHook.cs

示例13: Form1

        public Form1()
        {
            trackLastTypedTime();
            InitializeComponent();
            _proc = HookCallback; //Moved this from the fields to inside the constructor...
            //so I could change all the methods trying to change the non-static
            //secondsSinceLastTyped label to non-static methods.

            applicationEnabled = true;

            makeEmptyDataGridView();

            //InitializeMyScrollBar();
            //notifyIcon = new NotifyIcon();
            //notifyIcon.Visible = true;
            //notifyIcon.Icon = SystemIcons.Application;

            //-------Keylogging stuff------------

            //var handle = GetConsoleWindow();

            //// Hide
            //ShowWindow(handle, SW_HIDE);
            //These lines are neccesary for the printing of keys pressed to the console
            _hookID = SetHook(_proc);
            Application.Run(this);
            UnhookWindowsHookEx(_hookID);

            //-------End Keylogging stuff------------

            //typedChars = ""; //initialize typedChars to empty string
        }
开发者ID:badjr,项目名称:Macro-Project,代码行数:32,代码来源:Form1.cs

示例14: GlobalHotkey

 internal GlobalHotkey(HandleKeyDown handleKeyDown, Keys key, Keys modifiers)
 {
     keyHandleKeyDown = handleKeyDown;
     watchKey = key;
     watchModifers = modifiers;
     proc = HookCallback;
     hookId = SetHook(proc);
 }
开发者ID:jeffesp,项目名称:Persistent-Clipboard,代码行数:8,代码来源:GlobalHotkey.cs

示例15: KeyInterceptor

 public KeyInterceptor()
 {
     Task.Run(() => {
         _proc = HookCallback;
         _hookID = SetHook(_proc);
         Application.Run();
     });
 }
开发者ID:andrecarlucci,项目名称:NinjaDev,代码行数:8,代码来源:KeyInterceptor.cs


注:本文中的LowLevelKeyboardProc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。