Thread: hook question

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    2

    hook question

    Hi,
    I'm trying to find out if there's a global hook that I can hook to and receive messages about an application that is about to be run so that I can block or let pass the execution.

    Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    You mean like the way virus scanners do?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    2
    yeah, like that.

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    13
    Well, since you say application, that means it has to have a window. Create a global hook with WH_CBT that displays a notifification whenever HCBT_ACTIVATE or HCBT_CREATEWND messages occur. From this point, you can choose to allow the program to run or terminate it by finding the FileModuleName (not sure if thats the correct one, but you get my jist) and terminating the process.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Window Hook
    By paul_uk in forum Windows Programming
    Replies: 5
    Last Post: 11-28-2004, 10:56 AM
  3. Global hook only works on one window?
    By CornedBee in forum Windows Programming
    Replies: 5
    Last Post: 01-19-2004, 12:25 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Hook problem
    By mkyong in forum Windows Programming
    Replies: 1
    Last Post: 02-09-2003, 06:17 AM