The Macro Recorder Example
As mentioned previously, the example demonstrating this hook is an application that records user actions. You can play back these actions later using a different hook -- see the example in Chapter 20, where we’ll complete this portion of our application. Figure 19-3 displays a screenshot of this application.

Figure 19-3. A screenshot of the example application
Table 19-1 presents the nondefault properties of the form and its controls.
The RECORD frame on this form holds two buttons. The hook button will
install the WH_JOURNALRECORD hook, and the unhook
button will remove this hook. The TEST AREA frame includes an MSG BOX
button that displays a test message box with an OK button. A text box
and a checkbox also are included. You can use these controls to
record some simple macros. You also can record actions taken on other
applications.
To operate this application, click the hook button and then perform some actions. These actions could be clicking the MSG BOX button to create a message box, checking and unchecking the checkbox, or even performing actions on a separate application. To stop the recording, click the unhook button.
Initially this application will not do much. Chapter 20, which introduces the
WH_JOURNALPLAYBACK hook, will complete the
functionality for this macro recorder application.
Table 19-1. Nondefault Properties of the Form and Its Controls ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access