CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    WH_JOURNALRECORD hook params

    WH_JOURNALRECORD hook

    I'm writing a control to allow remote monitoring and shadowing of VB apps that uses a WH_JOURNALRECORD hook. All works grand, returning an EVENTMSG structure whenever the user interacts with my app - but I need to convert this to a proprietry message format 'cos the .hwnd on the remote machine is fairly meaningless on the debugging machine...so, I have the following structure:


    Type EVENTMSG
    message as Long
    paramL as Long
    paramH as Long
    time as Long
    hwnd as Long
    End Type




    From investigation, message is a WM_* message and paramL and paramH vary according to what message it is
    (i.e. for all the mouse messages, paramL is the x position and paramH is the y position)
    but hwnd is often zero so I have to do an IsWindow around that.

    Anyhow - (1) Anyone have any documentation on EVENTMSG that specifies the link between the message and the meaning of the paramH and paramL members or will I have to do all that all by trial and error, and (2) anybody got a better way of getting the control name and index from the .hwnd without iterating the controls collections?

    Thanks in advance,
    Duncan


    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com/EventVB/Overview.htm - Flatten the API learning curve
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: WH_JOURNALRECORD hook params

    nobody?

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com/EventVB/Overview.htm - Flatten the API learning curve
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: WH_JOURNALRECORD hook params

    Investigation so far

    Where message is WM_MOUSEMOVE or WM_LBUTTON* then .ParamH is the x position of the event and .ParamL is the y position.For WM_KEY* messages, .ParamH is the keyboard scancode, and LoByte(.ParamL) is the virtual key code.

    HTH,
    Duncan


    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com/EventVB/Overview.htm - Flatten the API learning curve
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  4. #4
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: WH_JOURNALRECORD hook params

    You hacking all that stuff??? I'd think the C/C++ folks might have some ideas.


  5. #5
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090

    Re: WH_JOURNALRECORD hook params

    The message element of the EVENTMSG structure is the message ID for the message, the WM_* value. The paramL and paramH values depend on whether the event is a mouse or a keyboard event. If it is a mouse event, the values contain the x and y coordinates of the event. If it is a keyboard event, paramL contains the scan code in the HIBYTE and the virtual-key code in the LOBYTE, and paramH contains the repeat count. Bit 15 of the repeat count specifies whether the event is an extended key. The time element of the EVENTMSG structure contains the system time (when the event occurred), which it obtained from the return value of GetTickCount. The hwnd is the window handle for the event.

    The amount of time between events is determined by comparing the time element of an event with the time of subsequent events. This time delta is needed when playing back the recorded events.

    Reference:
    http://www.anticracking.sk/EliCZ/imp...dn_hooks32.htm



    Help us improve our answers by rating them.


  6. #6
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: WH_JOURNALRECORD hook params

    I could have done with that reference one long sleepless night ago ...

    D.

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com/EventVB/Overview.htm - Flatten the API learning curve
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  7. #7
    Join Date
    Jun 2003
    Posts
    11

    Catching Ctrl-C with Journal hook?

    Hi,

    I'm working on a Journal hook, and wish to capture user's Ctrl-C to stop the hook. I can't find doc on how to do that in EVENTMSG. Any help is much appreciated.


    Will

  8. #8
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173
    WH_JOURNALRECORD cannot alter or remove a keyboard message - only record it. WH_KEYBOARD_LL can, however..suggest you look into that.
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  9. #9
    Join Date
    Jun 2003
    Posts
    11

    Here is what happened when W2K/IE patch comes along

    Hi,

    Thanks for your comment. After some digging I've found a way to handle Ctrl-C.

    I revisited Journal hook recently, and to my horror Journal playback doesn't work properly any more;
    Problem: Record hook to capture mouse clicks to activate a minimized app, say notepad, at the bottom sys. task bar and some key strokes for text. When playback, the mouse did click on the task bar but notepad didn't restore until the hook finished replaying (very often not at all!). The notepad did restore when I clicked it manually (not using the hook app).

    Could someone share ideas why??

    Many many thanks.

    P.S. I noticed with IE6 running I have proplems switching to other app. by clicking the task bar (sometimes but not every time)


    Will

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured