private int JournalRecordHook_Callback(int code, IntPtr wParam, IntPtr lParam, ref bool callNext) { if (code == HC_ACTION) { EVENTMSG em = (EVENTMSG)Marshal.PtrToStructure(lParam, typeof(EVENTMSG)); JournalMessage jm = JournalMessage.Create(em); if (RecordEvent != null) { RecordEvent(this, new JournalRecordEventArgs(jm)); } } else if (code == HC_SYSMODALON) { if (SystemModalDialogAppeared != null) { SystemModalDialogAppeared(this, new EventArgs()); } } else if (code == HC_SYSMODALOFF) { if (SystemModalDialogDisappeared != null) { SystemModalDialogDisappeared(this, new EventArgs()); } } return(0); }