The functions defined in the Windows API provide a valuable and powerful extension to the VBA developer's tool set. The API Viewer provides the VBA definitions for most of the core functions. The definitions for the remaining functions can be converted from the C-style versions shown in the online MSDN library.

Class modules enable the user to encapsulate both the API definitions and their use into simple chunks of functionality that are easy to use and reuse in VBA applications. A number of example classes and routines have been provided in this chapter to get you started using the Windows API functions within your applications, including:

□ Creating a TEMP file

□ A high-resolution timer

□ Freezing a UserForm

□ Getting system information

□ Modifying a UserForm's appearance

□ Making UserForms resizable, with a minimum of code in the form ft

0 0

Post a comment