hook

PHP function or file to run before and after every request

你说的曾经没有我的故事 提交于 2019-12-21 12:21:47
问题 I am wondering if there is a way to specify a php function or file to be called every time a user visits and exits a page on my site. So if a user visits say example.com/ex.php can I have a function called before ex.php is run and after ex.php is finished? I want to be able to record the time it takes to execute php files on my site and store that so I can run queries later to analyze the info. I would prefer not to have to add code to the beginning and end of every file I want to track.

Change the key being pressed with C#

ぐ巨炮叔叔 提交于 2019-12-21 12:00:14
问题 Hey, I'm trying to write a program in C# that will track the pressing of certain keys (using a keyboard hook), and send different ones instead. For instance, when I press the A key it will instead send the Q key. I used http://www.codeproject.com/KB/cs/CSLLKeyboardHook.aspx this for my hooks and tried to use the SendKeys function, but I get an exception about the garbage collector destroying some object inside the hook class. 回答1: First you need to hook up the keys. With this class you can

'Safe' DLL Injection

别等时光非礼了梦想. 提交于 2019-12-21 05:48:33
问题 Not a terribly good question, sorry. I have a program that needs to be alerted when a file is opened from explorer (i.e. ShellExecute(A/W) is called). Unfortunately, Microsoft removed the COM interface (IShellExecuteHook) that allows you to hook these events in Vista and up, supposedly because older code could cause a crash due to changes. There was a work-around to re-enable this feature, but it no longer works. I've done some research and it looks like the only way to catch calls to

Port Win32 DLL hook to Linux

狂风中的少年 提交于 2019-12-21 05:31:32
问题 I have a program (NWShader) which hooks into a second program's OpenGL calls (NWN) to do post-processing effects and whatnot. NWShader was originally built for Windows, generally modern versions (win32), and uses both DLL exports (to get Windows to load it and grab some OpenGL functions) and Detours (to hook into other functions). I'm using the trick where Win will look in the current directory for any DLLs before checking the sysdir, so it loads mine. I have on DLL that redirects with this

Port Win32 DLL hook to Linux

允我心安 提交于 2019-12-21 05:31:09
问题 I have a program (NWShader) which hooks into a second program's OpenGL calls (NWN) to do post-processing effects and whatnot. NWShader was originally built for Windows, generally modern versions (win32), and uses both DLL exports (to get Windows to load it and grab some OpenGL functions) and Detours (to hook into other functions). I'm using the trick where Win will look in the current directory for any DLLs before checking the sysdir, so it loads mine. I have on DLL that redirects with this

Hook into Wordpress image upload

倖福魔咒の 提交于 2019-12-21 05:23:11
问题 For my Wordpress website I want to generate programmatically and automatically an extra photo size while a user uploads a picture . I want this photo also to appear in the media library. I wrote a little side plugin which I activate to hook into the upload action. My question is, which wp upload action I should hook into to generate this extra size of the uploaded image. Example of getting the current upload and write the extra image entry are welcome. Thanks! 回答1: You can try wp_handle

How to add a system “windows hook” so as to be notified of windows being created/activated?

佐手、 提交于 2019-12-21 05:07:24
问题 Tried a bunch of things but I can't get it to work consistently amid my taskbar being nuked and other supernatural effects on my desktop UI. Tried using a open-library http://mwinapi.sourceforge.net/ first. Although it worked nicely as an OO layer for enumerating windows and stuff. It couldn't do hooks properly Next stop was Dino E.'s post on Windows Hooks in the .Net framework. I ended up writing my own type as I was understanding the text and trying to get this to work. My intention is to

Dynamic columns in liferay-ui:search-container?

天涯浪子 提交于 2019-12-21 03:46:19
问题 I have tried the liferay-ui:search-container to fetch and display the database table records on UI in a table/grid format. By using the liferay-ui:search-container I am getting the output as shown below, I am fetching the USER_ table records in the above screen shot. Problem: I wanted to make the grid columns dynamic like, I wanted to enable an option for end user to remove the unwanted columns and add the wanted columns in the respective grid/table. EX: In the above screen shot the the

C# - Hook into existing COM object

試著忘記壹切 提交于 2019-12-21 02:42:21
问题 Say we have an existing process (or application) that calls a COM object from an ocx file such as "MyCOMLibrary.ocx". Is there a way to write a C# library to exactly replicate the ocx file? So that the original application can call your C# code rather than the original COM object? You would, of course, have to use identical CLSID and ProgIDs as the original ocx. And assuming there is no signing involved, such as a SNK in the .Net world. Also, are there any tools that exist to automate this?

Calling functions in a DLL loaded by another process

為{幸葍}努か 提交于 2019-12-21 02:35:21
问题 I have a DLL that I inject into another process but I want to be able to call the exports on that DLL from my application. I've read elsewhere that you have to the SendMessage API but I have no idea what to do. Is there any example code on how this is done? 回答1: You can't directly call functions in another process, in general. There are, however, some workarounds you can use. First, if you know the address of the export (which isn't the case a lot of the time), and the function you call uses