Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Can we set a global hook in a COM object?

Can we set a global hook in a COM object?

Scheduled Pinned Locked Moved COM
comquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nadzzz
    wrote on last edited by
    #1

    in the SetWindowsHookEx function, I set the _pModule->get_m_hInst() as the HINSTANCE parameter. The relust of this code is a local hook on the procedure. "Global hook procedures should be placed in a separate DLL". is com is a separate DLL hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, _pModule->get_m_hInst(), 0); a related article is talking about the subject in a standart DLL (not COM). http://www.codeproject.com/win32/AntonioWinLock.asp

    J V 2 Replies Last reply
    0
    • N nadzzz

      in the SetWindowsHookEx function, I set the _pModule->get_m_hInst() as the HINSTANCE parameter. The relust of this code is a local hook on the procedure. "Global hook procedures should be placed in a separate DLL". is com is a separate DLL hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, _pModule->get_m_hInst(), 0); a related article is talking about the subject in a standart DLL (not COM). http://www.codeproject.com/win32/AntonioWinLock.asp

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      I don't see why it couldn't work. Why don't you just try it? -- My name in Katakana is ヨルゲン. My name in German is Jörgen. My name in Mandarin/Kanji is 乔尔根 西格瓦德森. I blog too now[^]

      1 Reply Last reply
      0
      • N nadzzz

        in the SetWindowsHookEx function, I set the _pModule->get_m_hInst() as the HINSTANCE parameter. The relust of this code is a local hook on the procedure. "Global hook procedures should be placed in a separate DLL". is com is a separate DLL hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, _pModule->get_m_hInst(), 0); a related article is talking about the subject in a standart DLL (not COM). http://www.codeproject.com/win32/AntonioWinLock.asp

        V Offline
        V Offline
        vishalmore
        wrote on last edited by
        #3

        Hi nadzzz, Is ur com object a dll ? - If it is then u can't install global hook, to install global hook ur application must be an exe (rather than dll) See the global hook docs for more info. :) Cheers, Vishal

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups