hook

What is a hook function?

Id like to know what excatly is a hook function. Explanation and example in php, c++, or java is fine. ...

Custom hooks in WordPress across plugins

I'm trying to create a hook in one Wordpress plugin that could be used by other plugins. First off, is this even possible? I'm also sending some additional args so this may be 2 questions in one since I've been having trouble finding definitive information on how to do this. Here is what I've tried so far: In the plugin that is creatin...

Mercurial - Copy latest revision to an arbitrary folder on commit if commit happens on a certain named branch (hook)?

I have a mercurial repository setup with a few named branches. I want to check if a commit occurs into a named branch of a certain name, and then push a copy of the head revision of the named branch to a "publish" folder. Example: Bobby commits a change to the "Development" branch. The script sees it was commited to the "Development" ...

How do I hook into other programs in Windows?

Can anyone explain how does one program hook into and modify behavior of other programs in Windows? How is it even possible? Don't windows programs protect themselves from other programs going into their memory, etc? (I don't know the internals how it works so I just said "into their memory" -- I bet it's more complex than that.) Also...

System wide Windows CBT hook not working properly

I'm trying to hook a CBT hook on Windows OSes. I'm currently using Windows 7 x64. I've read many threads talking about this issue, but none has solved my problem. The application runs well; the hook is installed and I can see some notifications coming. Actually the problems arised is that the application is not notified about CBT hook...

Hooking into Grails event in order to inject properties and methods without beeing af Plugin

Hi, I have some custom groovy classes in my Grails project, and I would like to inject a logger and some other stuff into the class, like it works in a Service class or Controller class. The code in the "target" class would in this way have direct access to logging without further ado. How would it be possible to write scripts to hook...

Unix invoke script when file is moved

Hi. I have tons of files dumped into a few different folders. I've tried organizing them several times, unfortunatly, there is no organization structure that consistently makes sense for all of them. I finally decided to write myself an application that I can add tags to files with, then the organization can be custom to the actual orga...

Can AppleScript listen for events?

I want to write a script that takes action when a document is opened on a certain application, or before an application quits, etc. Is there a way to attach a script to an event in an application? Does AppleScript support any form of hooks at all? If not, can I hack my way into getting what I want? ...

Is is possile to Hook file-download event of a program ?

Please tell me is it possile to know when a program is trying to download a file ( like in Internet Download Manager ). I want to catch that event (hook it), get the download url, and then destroy the event. Thanks in advance.. @Jerry Coffin:Sr, I forgot to tell you that this feature of IDM is not active by default. It is only turned on...

How do I set a system-wide API hook in Delphi?

Does anyone know about system-wide API hooking with Delphi? I downloaded madCodeHook, but it doesn't have any source, so I don't want use it; I want to program it myself. I found an article on Code Project, but it is in C++. Please help me to write it in Delphi 2010. ...

Help understanding a C++ sample app which uses global mouse event hooks?

I'm trying to understand and implement the sample presented in this MSDN forum thread. The sample involves implementing a global hook to catch mouse movement and click events, and act on them under certain circumstances. I know C# pretty well, but I don't know C++ enough to understand what this sample code is doing. The contributor of ...

How do I hook another applications events?

I'd like to hook the event that is triggered when an application is trying to notify you of something (when its icon background turns orange and starts flashing) so that I can create my own custom notifications (like getting a text message or email) For example I'd like to have an event triggered when I receive an instant message on my...

Rejecting a push based on commiter name.

I've recently set up a mercurial repsoitory. All pusing is done via ssh. Currently only users with an LDAP account can push changes to the repository. However, given that when commiting to a local repository any commiter name can be used using the --user. It is possible to have the situation where a commiter name does not match the LDAP ...

Can I redirect .NET method calls to a new method at runtime?

Suppose I have the following .NET classes: public class C { public void M() { .... } } and public class D { public void N() { .... } } These 2 classes reside in different namespaces, in different assemblies. Is there a way to cause all call to C.M() to 'redirect' automatically to D.N()? So,...

How are process hooks used

I've seen the concept out there, but how are they implemented? are they related only to operating system messages and system calls? i was thinking about event handling in GUI applications, detecting and handling the event itself and doing something is considered hooking? ...

Unloading DLL from all processes after unhooking global CBT hook

How do you properly unload a DLL from all processes when the system-wide hook that loaded them gets unloaded? From MSDN: You can release a global hook procedure by using UnhookWindowsHookEx, but this function does not free the DLL containing the hook procedure. This is because global hook procedures are called in the pr...

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

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...

ProxyDLL using Detours

Hi, I want to embed a button in MSN Messenger. I have identified some resources but all the codes are in C++. I want to make a proxyDLL using msacm32.dll and attach my dll using Detours. Can someone help me. Thanks ...

change node access with drupal module

I run drupal 6 and want to code this functionality: after the user filled out the formular he can click an extra button, which will make the form readonly for him. I thought about an hidden_field and an extra button, which after the user clicked the extra button set the hidden_field to a true state. When I load the node and the hidden_f...

How can I set up a CBT hook on a Win32 console window?

Hello, I've been trying to set up a CBT hook for my C++ Console application with the following code: ...includes... typedef struct _HOOKDATA { int type; HOOKPROC hookproc; HHOOK hhook; }_HOOKDATA; _HOOKDATA hookdata; //CBT LRESULT CALLBACK CBTProc(int code, WPARAM wParam, LPARAM lParam) { //do not proccess m...