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. C / C++ / MFC
  4. how to set journal hook?

how to set journal hook?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 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.
  • A Offline
    A Offline
    anminxin
    wrote on last edited by
    #1

    hello everyone, I want to write a program to record the event of keyboard, sb advise me to use journal hook. //g_hLogHook is a global hook if (g_hLogHook==NULL) g_hLogHook=SetWindowsHookEx(WH_JOURNALRECORD, (HOOKPROC)JournalLogProc,AfxGetInstanceHandle(),0); It will not return until I press Ctrl-Alt-Del to cancel the hook. It then has a valid handle for g_hLogHook.I'm at a loss as to why this hangs? can anyone give me a answer? ps:msdn Unlike most other global hook procedures, the JournalRecordProc and JournalPlaybackProc hook procedures are always called in the context of the thread that set the hook. now,now that JournalProc is always called in the context of the thread that set the hook,why all the threads on the desktop are hanging before I press Ctrl-Alt-Del ? thanks for your answer

    R 1 Reply Last reply
    0
    • A anminxin

      hello everyone, I want to write a program to record the event of keyboard, sb advise me to use journal hook. //g_hLogHook is a global hook if (g_hLogHook==NULL) g_hLogHook=SetWindowsHookEx(WH_JOURNALRECORD, (HOOKPROC)JournalLogProc,AfxGetInstanceHandle(),0); It will not return until I press Ctrl-Alt-Del to cancel the hook. It then has a valid handle for g_hLogHook.I'm at a loss as to why this hangs? can anyone give me a answer? ps:msdn Unlike most other global hook procedures, the JournalRecordProc and JournalPlaybackProc hook procedures are always called in the context of the thread that set the hook. now,now that JournalProc is always called in the context of the thread that set the hook,why all the threads on the desktop are hanging before I press Ctrl-Alt-Del ? thanks for your answer

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      Here is an article on Journal hooks http://www.codeproject.com/KB/applications/winmacro.aspx[^]

      It is a crappy thing, but it's life -^ Carlo Pallini

      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