Category Archive for: The Windows API

The Data Control’s Methods

The built-in functionality of the Data control, which is impressive indeed, can be accessed through an application’s code with the Data-control’s methods. The simplest methods are the navigation methods, which correspond to the actions of the four buttons on the control, and they are as follows: MoveFirst repositions the control to the first record. MoveLast repositions the control…

Read More →

Speeding Up Drawing Operations

Manipulating pixels with the SetPixelV() and GetPixelV() functions is significantly faster than using their Visual Basic counterparts, but it is still slow. There’s a better method, but it requires even more API functions. When you draw with Visual Basic methods on a Form, the drawing takes place it an area of the memory that is mapped on the…

Read More →

Drawing Functions

Visual Basic provides a few methods for drawing on Forms and PictureBoxes, which are discussed at length in Chapter 6. There are only a few drawing methods, hut they accept a variety of arguments and they are quite flexible. However, they are not as fast as their API counterparts (the functions a C++ program would call); Windows is a…

Read More →

Manipulating Graphics

Graphics attract users and are an important part of any application. A graphic can be a simple icon or a complex bitmap. This section describes some techniques for manipulating the display of bitmaps using the Win32 APIs. In this section, we’ll look at the API graphics functions, BitBlt() and StretchBlt() which are more or less equivalent to the PaintPicture method of…

Read More →

Registry Functions

The Windows 95/98 Registry is a hierarchical database of settings used by Windows that includes information on users, system hardware configuration, and application programs. The Registry system replaces the old INI files, where applications used to store information between sessions, used m previous versions of windows. You access the Registry using a program called Regedit. To run Regedit…

Read More →

Accessing the System

The API functions described in this section let you look at other running applications from within your Visual Basic application and obtain information about an application and ever i!s’parent window. Querying Other Applications To query an application, you must be able to tell your program which application to query. One way to do this is to place the…

Read More →

Changing Menus at Runtime

At times, you’ll want to change the menus dynamically. The MenuMod application. which is based on the MenuBMP application, shows how this can be done. VB6 at Work: The MenuMod Project  The MenuMod application lets you switch the menu items from bitmaps to text and back. The application has the same menu as the menuBMP application. plus third…

Read More →

Forms and Windows

This section describes Win32 API functions that you can use to extend the usual Visual Basic functions to enhance your Forms, windows; and menus. Using these functions, you can create menus that incorporate bitmaps and dynamically change menu items: You will also learn how to track the mouse and manipulate windows of other active applications on the Desktop.…

Read More →

Determining free Disk Space

This section describes the functions you use to determine a drive’s medium type and its free disk space and the functions you use to find the Windows directory arid the current directory; they are: GetDriveType() GetDiskFreeSpace() GetWindowsDirectory() GetCurrentl?irectory() These functions add capabilities that are normally not available with Visual Basic. For example, you can use them to determine…

Read More →

Declaring 32-Bit Functions and Structures

Some API functions use structures for their arguments. The MousePos application you’ll find it in the MousePos folder on the CD) demonstrates how to declare and use a simple structure. It uses the GetCursorPos() function to getthe current mouse position when the mouse is clicked. This function must report back to the application two values: the X and…

Read More →

Back to Top