ShellProcs

This is a discussion on ShellProcs within the Windows Programming forums, part of the Platform Specific Boards category; Hi all! i need a basic example for installing a globle shell hook. i think i know howto put a ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    365

    ShellProcs

    Hi all!
    i need a basic example for installing a globle shell hook. i think i know howto put a ShellProc in a dll and load it and call SetWindowsHookEx() from another app. But i havent seen a message handling ShellProc before. Could you guys please post an example of a working ShellProc, or direct me to a tutorial or something. Thanks for any help.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

  2. #2
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    I suppose it would look something like:
    Code:
    LRESULT CALLBACK MyShellProc(int nCode, WPARAM wParam, LPARAM lParam)
    {
      if (nCode<0)
        return CallNextHookEx(0,nCode,wParam,lParam);
    
      switch (nCode)
      {
      case HSHELL_WINDOWACTIVATED:
         //handle this message
      break;
      //handle other messages
      }
    
      return 0;
    }
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  3. #3
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    365
    will try that. Thanks.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

Popular pages Recent additions subscribe to a feed

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