hook

Is there a .NET library for sending keystrokes, mouse clicks, mouse movements and other input? Similar to AutoHotKey but for .NET library use?

ⅰ亾dé卋堺 提交于 2019-12-06 15:24:54
I'm looking to essentially write code similar to what I can do with AutoHotKey , only in .NET and C#, because it's a much more robust environment. I didn't know if there was a wrapper library available for these sorts of hooks or not. Does anyone know of a library that does this for .NET? This actually looks pretty promising, I haven't tested it yet, but it's at least a good starting point. Not too bad considering it's on CodeProject. lol. For sending keys you can use System.Windows.Forms.SendKeys . For mouse and other input you have to wrap the SendMessage API. 来源: https://stackoverflow.com

How to detect the input device if mouse and touchpad are both enabled

此生再无相见时 提交于 2019-12-06 14:28:30
I already have a WH_MOUSE_LL hook in my application, but need a different behavior for Mouse and Touchpad. I know about Raw Input API, but have no idea how to use it with hooks :( Any suggestions? Rob Kennedy It should be the same as distinguishing between multiple keyboard devices . Disassemble some Touchpad driver and see how it works. This is the only way to go, cause drivers might use different methods of mouse emulation. And don't forget to vote for my answer ;). I was tried cnPackRawInput and its working fine. it have a KeyboardFromHandle function and i can compare is it my special

Receive event before Windows enters standby or hibernate using Win32 API

元气小坏坏 提交于 2019-12-06 13:35:29
问题 I'm working on a small chat application written in C++/Qt. My users are complaining that the connection is not shut down gracefully when they are closing the laptop lid and the computer enters standby. Is there a Win32 hook available that is called when Windows is about to enter standby? 回答1: WM_POWERBROADCAST 回答2: Reimplement QCoreApplication::winEventFilter in your application to handle Windows standby events. 来源: https://stackoverflow.com/questions/5440133/receive-event-before-windows

Reading Explorer.exe's Thunk Data

和自甴很熟 提交于 2019-12-06 13:01:13
问题 I'm trying to do a little IAT hooking in explorer.exe. Specs: Windows 7 x64, Visual C++. I've made it to a point where I am capable of reading thunk data from any executable of my choosing except for C:\Windows\Explorer.exe. When I run my program against that I receive an access violation in reading memory from that executable. However, when I run this against C:\Windows\system32\Explorer.exe and C:\Windows\sysWOW64\Explorer.exe I don't have any problems. Why is this? Is C:\Windows\Explorer

Hook for pthread_create

巧了我就是萌 提交于 2019-12-06 11:51:46
Is there (in glibc-2.5 and newer) a way to define a hook for pthread_create? There is a lot of binary applications and I want to write a dynamic lib to be loaded via LD_PRELOAD I can add hook on entry to main (''attributte constructor''), but how can I force my code to be executed in every thread just before the thread's function will run. Employed Russian This answer shows how to interpose pthread_create. (Beware: it will work correctly in 64-bit, but not 32-bit programs.) Once you interpose pthread_create, you can make it call your own function, which will do whatever you want, and then call

How to use SetWindowsHookEx in Vista and hook Admin apps with UAC?

六眼飞鱼酱① 提交于 2019-12-06 11:48:12
I'm trying to figure out if there's a way to use SetWindowsHookEx and be able to affect apps that are run with Admin rights on Vista, with UAC enabled. This is an app that will need to add a small button to the caption bar of other windows to enable some multi-monitor-aware handling. I would have thought this couldn't be done, but I've seen one app that appears to do this. As far as I can tell, this other apps is not being run with Admin rights, and yet it can affect all apps in the system, including those with Admin privilege. It would seem that there's a way to do this, then, but I'm at a

Phonegap Hook - execvp Permission denied

拜拜、爱过 提交于 2019-12-06 10:52:43
问题 I'm trying to run a phonegap hook which I found on the net but I always get the same error on build execvp() Permission denied the hook is the "splash and icon" hook located here: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/#comment-332073 any help is much appreciated 回答1: Found the answer chmod -R 777 before_build 回答2: Even i got the same error when i tried to add a platform to the ionic application. Its not just the problem with phone gap. It is also a

Problems on injecting into printf using LD_PRELOAD method

这一生的挚爱 提交于 2019-12-06 10:14:11
I was hacking printf() of glibc in one of my project and encountered some problem. Could you please give some clues? And one of my concern is why the same solution for malloc/free works perfect! As attached, “PrintfHank.c” contains my own solution of printf() which will be preloaded before standard library; and “main.c” just outputs a sentence using printf(). After editing two files, I issued following commands: compile main.c gcc –Wall –o main main.c create my own library gcc –Wall –fPIC –shared –o PrintfHank.so PrintfHank.c –ldl test the new library LD_PRELOAD=”$mypath/PrintfHank.so” $mypath

Can a script be automated after a commit on Perforce?

霸气de小男生 提交于 2019-12-06 09:58:49
We use Perforce at work, and routinely keep software projects in the repository. In general creators follow the normal Perforce flow, BUT we also have a class of users, who doesn't have any need to edit the files but only read them. Currently we use P4Web but that requires the user so download each file individually to reassemble the project directory. Ideally I would like to have a process where when a user does a commit/submit in Perforce, the script would automatically run to generate a single zip file of the project directory and files, so that it was a one-click download that was

Hook some regular tasks?

断了今生、忘了曾经 提交于 2019-12-06 09:51:48
I'm wondering if the following is possible: I've an app (service) that stays in background, and gets triggered whenever the user Adds/deletes/updates a contact Installs/uninstalls an app Adds/deletes/renames a file on the FS Do you think this is possible guys? (in a proper way of course, if it's possible to do it by hacking and dirty stuff I'd pass) I tried to look over the internet a bit but didn't find discussions related to this point. What's your guess ? RivieraKid Haven't tried any of this myself, but: http://mylifewithandroid.blogspot.com/2008/03/observing-content.html seems to deal with