![]() These APIs are used by assembly language programmers to gain programmatic access to the BIOS and DOS services. For instance, it would be reasonable to say the Microsoft Excel object model is the application programming interface for Excel, and similarly, the Word object model is the API for Microsoft Word, and the Data Access Objects (DAO) object model is the API for the Jet database engine.Įven the PC BIOS and the DOS operating system have APIs. Microsoft Windows is not the only application that has an API. ![]() ![]() Search for an icon that matches certain criteria LookupIconIdFromDirectory and LookupIconIdFromDirectoryEx Loads an icon from a specified module or application instance To get an idea of what some of these API functions can do, let's take a quick look at the icon-related functions.Ĭreates an icon from raw data in a resource fileĮxtractIcon, ExtractIconEx, and ExtractAssociatedIconĮxtract icons from an executable file (EXE or DLL) This table will give you a good idea of the type of services rendered by the Win32 API.Ĭoordinate Space and Transformation Functions Table 1-1 shows some categories of Win32 API functions. The Win32 API consists of well over 2,000 functions for performing all sorts of operating system services. Generally speaking, application programming interfaces take the form of a collection of functions (we include subroutines in this generic term) that provide the application's services. More specifically, the Win32 API consists of a collection of functions and subroutines that provide programmatic access to the features of the operating system. The Win32 Application Programming Interface, or Win32 API for short, is the programming interface that is used to programmatically control these operating systems. Understand the format of executable files, as well as such things as which functions a DLL exports and which DLLs an executable file usesĪt the present time, Microsoft offers two 32-bit operating systems Windows 98 and Windows NT. Learn how to map the memory space for a process Install a clipboard viewer to save the results of more than one copy operation for later pastingįinally, you will learn some of the secrets of how Windows operates, so that you can: Inject a DLL into another process space and execute the code in the DLLĭraw using the Windows GDI drawing functions ![]() Install local or global hooks to monitor or alter the behavior of the mouse or keyboard Subclass windows (and controls) to change their behavior Synchronize two VB applications so that they can work in cooperation with each other (one application pauses while the other completes a task)Įxtract data from controls that belong to another application In addition, you will learn several advanced programming techniques that can be used in your VB applications, such as how to: Gather system information, such as which version of Windows is running on a system (Windows 95, 98 or NT), the full pathname of the Windows directory, the screen resolution, or the number of buttons on the user's mouse To get a better feel for the additional power provided by the Win32 API, let's look at some of the simpler things you will learn to do under Visual Basic using the Win32 API:Īdd a horizontal scroll bar to a VB list boxĭetermine whether a VB application is already running and prevent multiple instances of the application This is partly because of the added complexity that surrounds operating system programming and partly because of the apparent sense on Microsoft's part that VB programmers need to be protected from these complexities (and thus from making more ''serious" programming errors than are possible in VB). The simple answer is that the Win32 API functions allow the VB programmer to access the raw power of the Windows operating system.įor better or worse, the Visual Basic programming environment per se attempts to shield the programmer from the full power of the Windows operating system. It is natural to wonder why a Visual Basic programmer would be interested in using the Win32 API. DECLARING API FUNCTIONS IN VISUAL BASICĪs we mentioned in the Preface, this book is intended for the intermediate or higher Visual Basic programmer and has two goals:ĭescribe the Win32 API and how to program it from Visual Basic versions 5.0 and 6.0ĭescribe the basic operation of the Windows NT and Windows 9x operating systems.
0 Comments
Leave a Reply. |