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. trouble with "Windows Journal Hook"

trouble with "Windows Journal Hook"

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • C Offline
    C Offline
    Cold_Fearing_Bird
    wrote on last edited by
    #1

    I have read the MSDN document section about Journal Hook over and over again, still be confused with the following things. 1.Does the Journal Record Hook record the user actions( like mouse clicks or keyboard events ), then Journal Playback Hook replays the series of actions which the user has just performed? 2.The lParam of the JournalRecordProc is a pointer to a EVENTMSG, I can copy it to a buffer as the MSDN tells us to, but what are we supposed to do with these EVENTMSG buffer? 3.The lParam of the JournalPlaybackProc is also a pointer to a EVENTMSG, I think this EVENTMSG is one of the actions which the user has just performed, what should we do with it in order to replay the action?

    _ 1 Reply Last reply
    0
    • C Cold_Fearing_Bird

      I have read the MSDN document section about Journal Hook over and over again, still be confused with the following things. 1.Does the Journal Record Hook record the user actions( like mouse clicks or keyboard events ), then Journal Playback Hook replays the series of actions which the user has just performed? 2.The lParam of the JournalRecordProc is a pointer to a EVENTMSG, I can copy it to a buffer as the MSDN tells us to, but what are we supposed to do with these EVENTMSG buffer? 3.The lParam of the JournalPlaybackProc is also a pointer to a EVENTMSG, I think this EVENTMSG is one of the actions which the user has just performed, what should we do with it in order to replay the action?

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      During Journal Record, you need to make copies of the EVENTMSG structures passed in lParam. You can do this by creating a vector or EVENTMSG structures - std::vector<EVENTMSG> vEventMsgs; Whenever the journal hook callback is called you can use std::vector::push_back to make copies of this structure. During playback, copy back the stored EVENTMSG structures to lParam. The return value from the journal playback callback must be the amount of time to wait till the next journal playback callback is called. You can calculate this from the time member of the EVENTMSG structure. Take a look at this article to find out how its done - Writing a Macro Recorder/Player using Win32 Journal Hooks[^]

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++)

      Polymorphism in C

      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