JournalPlaybackProc

3.1

  LRESULT CALLBACK JournalPlaybackProc(code, wParam, lParam)    
  int code; /* process-message flag, */  
  WPARAM wParam; /* undefined */
  LPARAM lParam; /* address of structure for message */

The JournalPlaybackProc function is a library-defined callback function that a library can use to insert mouse and keyboard messages into the system message queue. Typically, a library uses this function to play back a series of mouse and keyboard messages that were recorded earlier by using the JournalRecordProc function. Regular mouse and keyboard input is disabled as long as a JournalPlaybackProc function is installed.

Parameters

code

Specifies whether the callback function should process the message or call the CallNextHookEx function. If this parameter is less than zero, the callback function should pass the message to CallNextHookEx without further processing.

wParam

Specifies a NULL value.

lParam

Points to an EVENTMSG structure that represents the message being processed by the callback function. The EVENTMSG structure has the following form:

typedef struct tagEVENTMSG {    /* em */
    UINT  message;
    UINT  paramL;
    UINT  paramH;
    DWORD time;
} EVENTMSG;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

The callback function should return a value that represents the amount of time, in clock ticks, that the system should wait before processing the message. This value can be computed by calculating the difference between the time members of the current and previous input messages. If the function returns zero, the message is processed immediately.

Comments

The JournalPlaybackProc function should copy an input message to the lParam parameter. The message must have been recorded by using a JournalRecordProc callback function, which should not modify the message.

Once the function returns control to the system, the message continues to be processed. If the code parameter is HC_SKIP, the filter function should prepare to return the next recorded event message on its next call.

This callback function should reside in a dynamic-link library.

An application must install the callback function by specifying the WH_JOURNALPLAYBACK filter type and the procedure-instance address of the callback function in a call to the SetWindowsHookEx function.

JournalPlaybackProc is a placeholder for the library-defined function name. The actual name must be exported by including it in an EXPORTS statement in the library's module-definition file.

See Also

CallNextHookEx, JournalRecordProc, SetWindowsHookEx