hook question

This is a discussion on hook question within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I'm trying to find out if there's a global hook that I can hook to and receive messages about ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 09:56 AM
  3. Global hook only works on one window?
    By CornedBee in forum Windows Programming
    Replies: 5
    Last Post: 01-19-2004, 11:25 AM
  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, 05:17 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21