WH_JOURNALRECORD lParm marshall / unmarshall

  • Thread starter Thread starter - HAL9000
  • Start date Start date
H

- HAL9000

Hello visual basic warriors,

It appears as though I have successfully written a system level
WH_JOURNALRECORD using visual studio dot net 2002. I do seem to be
getting mouse and keyboard events.

The problem is that I don't seem to be getting good lParm data. I
created what seemed like the correct structure (see below) and it
isn't working. Every mouse / keyboard action produces almost
identical EventMsgStructure data entries.

Specifically, the following doesn't seem to marshall / unmarshall
"lParam" correctly :

Delegate Function HookCallback(ByVal Code As Integer, ByVal wParam
As Integer, ByVal lParam As EventMsgStructure) As IntPtr

Public Structure EventMsgStructure
Public message As Integer
Public paramL As Integer
Public paramH As Integer
Public time As Integer
Public hwnd As Integer
End Structure

Do I need to use CopyMemory API or something?

Thanks for you help.
 
Delegate Function HookCallback(ByVal Code As Integer, ByVal wParam
As Integer, ByVal lParam As EventMsgStructure) As IntPtr
^^^^^

Should be ByRef



Mattias
 
Thank you sir ! ! That was it ! !

I'm too new to visual basic to know you could pass by reference.

Thanks again,
Forrest
 
Back
Top