When youre using a software program, the program doesnt interface directly with your computer hardware. Instead, Windows handles all communication from the software to the hardware and provides all necessary resources for the program to run. When a software designer creates a software program, he doesnt have to reinvent the wheel. Windows provides a library of common elements that all programs can use. For example, a programmer doesnt have to design a new menu system from scratch; he can use the common menu elements offered by Windows application programming interfaces (APIs).
APIs arent just for visual program elements. An API provides a consistent way for applications to use all the resources of your computer system. APIs control all common program operations. For example, the print function in a software program uses Windows print API, which controls all aspects of printing and makes the print operation the same in all Windows applications. The programmer doesnt have to write a lot of complicated code to create a new print function; he writes a few lines of code to access Windows print API and trusts Windows to do the rest. Heres how it works in practice. When a user clicks the Print button in a program, the program executes a line of code that runs the Windows print API.
The print API instructs Windows to affectation the accepted print chat box aural the aboriginal program. When the user initiates printing, the book API manages the abstracts breeze from the affairs to your computers anamnesis and microprocessor, which runs the book process. Windows again sends the abstracts to be printed to the adapted accessory disciplinarian for your printer, which again instructs your printer to book the document. Your printer now prints the document, just as you instructed.




