Background Processing Example
The WH_FOREGROUNDIDLE
hook example for this
chapter
will simply
increment a number in a text
box. Figure 14-3 shows a screenshot of the example application.
This application has two buttons. The hook button will install the
hook, and the unhook button will remove the hook. If the user tries
to close the application before removing the hook, the application
will display a message box informing the user to first click the
unhook button and then shut down the application.
Figure 14-3. A screenshot of the example application
Table 14-1 lists the nondefault properties of the form and its controls.
Table 14-1. Nondefault Properties of the Form and Its Controls
Object Type |
Property Name |
Property Value |
---|---|---|
Form |
Name |
Form1 |
Form |
Caption |
“WH_FOREGROUNDIDLE Hook” |
Form |
Top |
420 |
Form |
Left |
132 |
Form |
Height |
1572 |
Form |
Width |
6972 |
Text Box |
Name |
Text1 |
Text Box |
Top |
240 |
Text Box |
Left |
1440 |
Text Box |
Height |
1212 |
Text Box |
Width |
5412 |
Text Box |
ScrollBars |
3-Both |
Frame |
Caption |
“IDLE” |
Frame |
Name |
Frame1 |
Frame |
Top |
120 |
Frame |
Left |
120 |
Frame |
Height |
1335 |
Frame |
Width |
1155 |
Command Button |
Name |
Command1 |
Command Button |
Caption |
“hook” |
Command Button |
Top |
300 |
Command Button |
Left |
120 |
Command Button |
Height |
315 |
Command Button |
Width |
915 |
Command Button |
Name |
Command2 |
Command Button |
Caption |
“unhook” |
Command Button |
Top |
Get Subclassing and Hooking with Visual Basic now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.