get Keyboard Hooks from a particular application
-
I am trying to get keyboard and mouse hooks. I am able to install hooks in my system and also get the hooks. But i am trying to get hooks from a particular application, so is there any way to get it or it is possible that when i am installing the hooks then i am able to install for a particular application only. I am using the following url as a sample application. http://www.codeproject.com/KB/system/globalsystemhook.aspx Please help me..
-
I am trying to get keyboard and mouse hooks. I am able to install hooks in my system and also get the hooks. But i am trying to get hooks from a particular application, so is there any way to get it or it is possible that when i am installing the hooks then i am able to install for a particular application only. I am using the following url as a sample application. http://www.codeproject.com/KB/system/globalsystemhook.aspx Please help me..
If you are trying to install global hook,you have to know that .NET Framework doesn't support that :laugh: .You need a native DLL(based of MFC library for example),because .NET assembly doesn't support DLL exports(which are used for LoadLibary native function),required by the global hooks.Read bottom lines of this article.
Life is a stage and we are all actors!
-
I am trying to get keyboard and mouse hooks. I am able to install hooks in my system and also get the hooks. But i am trying to get hooks from a particular application, so is there any way to get it or it is possible that when i am installing the hooks then i am able to install for a particular application only. I am using the following url as a sample application. http://www.codeproject.com/KB/system/globalsystemhook.aspx Please help me..
you can do this only by using native dlls..... If you already installed the hooks successfully then the task is much simply accomplished by just getting the active application by getting the active window. Get the handle of the ActiveWindow. you can refer this page.link[^] Determine the application from the handle and map the current mouse and keyboard events to this application.
Have a Happy Coding.....
-
If you are trying to install global hook,you have to know that .NET Framework doesn't support that :laugh: .You need a native DLL(based of MFC library for example),because .NET assembly doesn't support DLL exports(which are used for LoadLibary native function),required by the global hooks.Read bottom lines of this article.
Life is a stage and we are all actors!
ya i knw .NET Framework doesn't support this. I am using same dll and using this i am able to install hooks and also able to get the events on pressing of keys. But i want to install the hooks for a particular application, so is there any method that give me this functionality or is there any way to get the application name on which we have pressing keys, so that i can do something on events if hooks comes from a particular application.
-
you can do this only by using native dlls..... If you already installed the hooks successfully then the task is much simply accomplished by just getting the active application by getting the active window. Get the handle of the ActiveWindow. you can refer this page.link[^] Determine the application from the handle and map the current mouse and keyboard events to this application.
Have a Happy Coding.....
-
:) :) :) :) :) :)
Have a Happy Coding.....