Introduced
API (Application Programming Interface), I think we will not be unfamiliar, it is our Windows programming regulars, though based. NET platform, C # has a powerful class library, but we still can't deny the importance of APIs in Windows programming. Most programming languages support API programming, and the MFC (Microsoft Foundation Class Library) architecture in the. NET platform encapsulates most of the APIs.
As programmers, we need to understand that the API is literally a programming interface, so as a developer, what you need to know is how the API is used.
The API has many different types depending on the operating system, processor, and functionality. Operating system-specific APIs:
Each operating system has a number of common APIs and some special APIs that can only be executed in the current operating system.
For example:
Windows NT supports MS-DOS, Win16, Win32, POSIX (Portable operating System Interface), OS/2 console API; Windows 95 supports MS-DOS, Win16, and Win32 APIs.
Win16 & Win32 API:
The Win16 is developed for 16-bit processors and is supported by early operating systems.
Win32 is developed for 32-bit processors. It is highly portable and is supported by most processors.
The Win32 API has a "32" suffix after the library name. such as Kernel32,user32 and so on.
All APIs run in the following 3 libraries:
Kernel
User
GDI
1. KERNEL
His library name is KERNEL32. DLL, which is used primarily to produce an association with the operating system:
Program loading
Context selection.
file input and output.
Memory management.
For example, the GlobalMemoryStatus function includes the current physical memory and virtual memory usage information.
2. USER
This class library is named USER32 in the Win32. Dll.
It allows you to manage all the user interfaces, such as:
Window
Menu
dialog box
icons, and so on.
For example, the DrawIcon function will "draw" an icon or mouse on the specified device association.
3. GDI (graphical Device Interface)
Its library name in Win32 is: GDI32.dll, which is the graphics output library. Use GDI windows "draw" out windows, menus, and dialog boxes:
It can create graphics output.
It can also save graphics files.
For example, the CreateBitmap function creates a bitmap from the specified length, width, and color.