• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 476
  • Last Modified:

Can/should I use Detours for Hooking an external application with VB.Net?

I've never written a hook before but I have read up on the topic.  What I'm trying to do from my VB.net application is to add a hook for an external application.   For example, say I was trying to write a hook that would prevent Notepad.exe from being closed.  So I'm wondering if I could use Detours from VB.net to accomplish this, or even if I should?
1 Solution
The baic point is that from .NET, you can't do API hooking, so that leaves you only with the option to use unmanaged code for that in the 1st place. Detours is a nice toolset for that, but depending on what you actually want to achieve, something like http://www.codeproject.com/system/hooksys.asp ("API hooking revealed") might also do the job.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now