What is windows application programming interface

Windows Application Programming Interface

Windows API (application programming interfaces) — общее наименование целого набора базовых функций интерфейсов программирования приложений операционных систем семейств Windows и Windows NT корпорации «Майкрософт». Является самым прямым способом взаимодействия приложений с Windows. Для создания программ, использующих Windows API, «Майкрософт» выпускает библиотек, утилит и других инструментальных средств.

Содержание

Общие сведения

Windows API был изначально спроектирован для использования в программах, написанных на языке C (или C++). Работа через Windows API — это наиболее близкий к системе способ взаимодействия с ней из прикладных программ. Более низкий уровень доступа, необходимый только для драйверов устройств, в текущих версиях Windows предоставляется через Windows Driver Model.

Версии

  • Win16 — первая версия Windows API для 16-разрядных версий Windows. Изначально назывался просто Windows API, затем стал называться Win16 для отличия от Win32.
  • Win32s — подмножество Win32, устанавливаемое на семейство 16-разрядных систем Windows 3.x и реализующее ограниченный набор функций Win32 API для этих систем.
  • Win32 — 32-разрядный API для современных версий Windows. Самая популярная ныне версия. Базовые функции этого API реализованы в kernel32.dll и advapi32.dll; базовые модули GUI — в user32.dll и gdi32.dll. Win32 появился вместе с Windows NT и затем был перенесён (в несколько ограниченном виде) в системы серии Windows 9x. В современных версиях Windows, происходящих от Windows NT, работу Win32 GUI обеспечивают два модуля: csrss.exe (Client/Server Runtime Subsystem), работающий в пользовательском режиме, и win32k.sys в режиме ядра. Работу же системных Win32 API обеспечивает ядро — ntoskrnl.exe
  • Win64 — 64-разрядная версия Win32, содержащая дополнительные функции для использования на 64-разрядных компьютерах. Win64 API можно найти только в 64-разрядных версиях Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008 и Windows 7.

Полный алфавитный список технологий, доступных через Windows API

  • Access Control
  • Active Accessibility
  • Active Directory
  • Active Directory Services Interface (ASP)
  • ActiveX Data Objects (
  • Automation
  • Background Intelligent Transfer Service (BITS)
  • Certificate Services
  • Collaboration Data Objects
  • Cryptography
  • Debugging and Error Handling
  • Device I/O
  • Distributed File System (Dfs)
  • Threads
  • Domain Name System (DHCP)
  • Extensible Authentication Protocol (XML) и парсер
  • Group Policy
  • ICS и ICF
  • Image Color Management (ICM)
  • Indexing Service
  • Infrared Data Association (IrDa)
  • Internet Authentication Service (IAS)
  • Internet Connection Sharing and Firewall (ICSF)
  • Internet Explorer
  • Internet Information Services (IIS)
  • Internet Protocol Helper (IP Helper)
  • Interprocess Communications
  • Lightweight Directory Access Protocol (LSA Authentication
  • LSA Policy
  • Memory Management
  • Message Queuing (MSMQ)
  • Messaging Application Programming Interface (
  • Microsoft Agent
  • Microsoft Data Access Components (MIDL)
  • Microsoft Management Console (MTS)
  • Multicast Address Dynamic Client Allocation Protocol (MADCAP)
  • Multicast Group Manager
  • National Language Support
  • NetMeeting
  • NetShell
  • Network Load Balancing Provider
  • Network Management
  • Network Monitor
  • Network Provider API
  • OLE DB
  • OLE DB Provider for Internet Publishing
  • OnNow
  • Open Database Connectivity (OpenGL
  • Password Filters
  • PC Health
  • Performance Monitoring
  • Plug and Play и Universal Plug and Play
  • Power Management
  • Quality of Service (
  • Remote Access Service (RAS)
  • Remote Procedure Call (имеется в виду служба RPC Service)
  • Removable Storage Manager (RSM)
  • Routing and Remote Access Service (RRAS)
  • Routing Table Manager Version 1 (RTMV1)
  • Routing Table Manager Version 2 (RTMV2)
  • Security Support Provider Interface (SSPI)
  • Server Cluster API
  • Server Data Objects (SDO)
  • Service Security Attachments
  • Setup API
  • Shell (имеется в виду Explorer Shell)
  • Side-by-side Assemblies
  • Simple Network Management Protocol (
  • Still Image
  • Storage и Structured Storage
  • Synchronization Manager
  • System.DirectoryServices
  • System Event Notification Service (SENS)
  • System Restore
  • Tablet PC
  • Task Scheduler
  • Telephony Application Programming Interface (TAPI) 2.2
  • Telephony Application Programming Interface (TAPI) 3
  • Telephony Service Provider Interface (TSPI и MSPI)
  • Terminal Services
  • Text Services Framework
  • Unicode (и MSLU)
  • Universal Description, Discovery, and Integration (
  • Windows Clustering
  • Windows File Protection
  • Windows
  • Windows Image Acquisition (WIA)
  • Windows Installer
  • Windows Management Instrumentation (
  • Windows Sockets
  • Windows System Information
  • Windows User Interface
  • Winlogon и Gina
  • WinSNMP

См. также

Ссылки

  • WinAPI @ dmoz.org
  • windows api programming — Форум клуба программистов
  • Platform SDK: Windows API — раздел Windows API в библиотеке MSDN
  • Открытая документация по WinAPI

Литература

  • Гэри Неббет Справочник по базовым функциям API Windows NT/2000 = Windows NT/2000 Native API Reference. — М.: «Вильямс», 2002. — С. 528. — ISBN 1-57870-199-6
Программные интерфейсы и Microsoft Windows
Графика Проводник Windows • Direct3D • Windows Presentation Foundation • Windows Color System • Windows Image Acquisition • Windows Imaging Component
Звук MME
Мультимедиа DirectShow • Windows Media • Media Foundation
Веб MSHTML • JScript • ActiveX •
Доступ к данным Компоненты Microsoft Data Access • Extensible Storage Engine •
Сети Winsock (LSP) • Filtering Platform •
Коммуникации TAPI
Администрирование Консоль Win32 • Windows Script Host • Инструментарий управления Windows • PowerShell • Планировщик задач • Offline Files • Теневое копирование • Windows Installer • Диспетчер ошибок Windows • Журнал событий Windows
Модель компонентов COM • COM+ • DCOM • .NET Framework
Библиотеки Microsoft Foundation Classes (MFC) • Active Template Library (ATL) • Windows Template Library (WTL) • Framework Class Library (FCL)
Разработка драйверов Модель драйверов Windows • Windows Driver Foundation (KMDF • UMDF)
Безопасность Windows CardSpace • Data protection API • Security Support Provider Interface
.NET .NET Framework • ADO.NET • .NET Remoting • Windows Presentation Foundation • Windows Workflow Foundation • Windows Communication Foundation • Windows CardSpace • XNA •
Межпроцессное
взаимодействие
MSRPC • Именованные каналы
Текст и
поддержка языков
Framework Текстовых сервисов • Объектная модель текстов • • Языковые пакеты • Многоязычный интерфейс
Игры XNA •
Widget toolkit
Low-level Macintosh Toolbox/Carbon · Windows API · Intrinsics · Intuition · High-level
Amiga OS BOOPSI · Magic User Interface · Zune · ReAction GUI
Mac OS и Mac OS X · MacApp · MacZoop · PowerPlant
Microsoft Windows Microsoft Foundation Classes · Windows Template Library · SmartWin++ · Object Windows Library · Visual Component Library · Windows Forms · Windows Presentation Foundation
Unix, under the X Xaw · · · InterViews
Cross-platform Based on Flash: Adobe Flex · · SWF2EXE Software

Wikimedia Foundation . 2010 .

Смотреть что такое «Windows Application Programming Interface» в других словарях:

Windows Application Programming Interface — Das Windows Application Programming Interface (kurz: WinAPI; Englisch für: Windows Anwendungs Programmierschnittstelle) ist eine Programmierschnittstelle und Laufzeitumgebung, welche Programmierern bereitsteht, um Anwendungsprogramme für… … Deutsch Wikipedia

Application programming interface — API redirects here. For other uses, see API (disambiguation). An application programming interface (API) is a source code based specification intended to be used as an interface by software components to communicate with each other. An API may… … Wikipedia

application programming interface — programų sąsaja statusas T sritis informatika apibrėžtis Susitarimų ir procedūrų rinkinys ryšiams tarp atskirų programų ir ↑operacinės sistemos realizuoti. Yra komponentinių ir modulinių sistemų projektavimo ir veikimo pagrindas. Operacinės… … Enciklopedinis kompiuterijos žodynas

Application Programming Interface — Eine Programmierschnittstelle ist eine Schnittstelle, die von einem Softwaresystem anderen Programmen zur Anbindung an das System zur Verfügung gestellt wird. Oft wird dafür die Abkürzung API (für engl. application programming interface, deutsch … Deutsch Wikipedia

Application programming interface — Eine Programmierschnittstelle ist eine Schnittstelle, die von einem Softwaresystem anderen Programmen zur Anbindung an das System zur Verfügung gestellt wird. Oft wird dafür die Abkürzung API (für engl. application programming interface, deutsch … Deutsch Wikipedia

application programming interface — Abbreviated API. The complete set of all operating system functions that an application can use to perform such tasks as managing files and displaying information. An API provides a standard way to write an application, and it also describes… … Dictionary of networking

Speech Application Programming Interface — The Speech Application Programming Interface or SAPI is an API developed by Microsoft to allow the use of speech recognition and speech synthesis within Windows applications. To date a number of versions of the API have been released, which have… … Wikipedia

Telephony Application Programming Interface — The Telephony Application Programming Interface (TAPI) is a Microsoft Windows API, which provides computer telephony integration and enables PCs running Microsoft Windows to use telephone services. Different versions of TAPI are available on… … Wikipedia

Messaging Application Programming Interface — (MAPI) is a messaging architecture and a Component Object Model based API for Microsoft Windows. MAPI allows client programmes to become (e mail) messaging enabled, aware, or based by calling MAPI subsystem routines that interface with certain… … Wikipedia

What is an API? Application programming interfaces explained

Application programming interfaces hide complexity from developers, extend systems to partners, organize code, and make components reusable

Contributing Editor, InfoWorld |

API stands for application programming interface, a concept that applies everywhere from command-line tools to enterprise Java code to Ruby on Rails web apps. An API is a way to programmatically interact with a separate software component or resource.

Unless you write every single line of code from scratch, you’re going to be interacting with external software components, each with its own API. Even if you do write something entirely from scratch, a well-designed software application will have internal APIs to help organize code and make components more reusable. And there are numerous public APIs that allow you to tap into functionality developed elsewhere over the web.

[ Also on InfoWorld: 27 essential tips for Git and GitHub users ]

What is an API?

An API is defined as a specification of possible interactions with a software component. What does that mean, exactly? Well, imagine that a car was a software component. Its API would include information about what it can do—accelerate, brake, turn on the radio, etc. It would also include information about how you could make it do those things. For instance, to accelerate, you put your foot on the gas pedal and push.

The API doesn’t have to explain what happens inside the engine when you put your foot on the accelerator. That’s why, if you learned to drive a car with an internal combustion engine, you can get behind the wheel of an electric car without having to learn a whole new set of skills. The what and how information come together in the API definition, which is abstract and separate from the car itself.

One thing to keep in mind is that the name of some APIs is often used to refer to both the specification of the interactions and to the actual software component you interact with. The phrase “Twitter API,” for example, not only refers to the set of rules for programmatically interacting with Twitter, but is generally understood to mean the thing you interact with, as in “We’re doing analysis on the tweets we got from the Twitter API.”

API as abstraction layer

When it comes to software, APIs are literally everywhere. APIs go hand in hand with one of the most fundamental concepts in computer science: abstraction. Abstraction is just a way of organizing the complexity of a system so that complicated actions can be handled in a simple way. Think of this abstraction like those Amazon Dash Buttons, the battery operated, push-button circuit boards you can use to order staples from Amazon. This is what they look like:

A few examples of Amazon Dash buttons. Order more detergent or paper towels at the press of a button.

You order a Dash Button from Amazon and use an app on your smartphone to associate it with your Wi-Fi network, your Amazon account, and a product, say, your favorite brand of paper towels. Then, whenever you want to order more paper towels, you just press the button. The Dash Button connects to the Internet and sends a message to place an order on your account. A few days later, paper towels arrive at your doorstep.

Like an API, the Dash Button is a blissfully simple interface that hides all kinds of complexity behind the scenes. The ID of the product you ordered must be retrieved from some database. Your delivery address must be pulled from your account. The nearest fulfillment center stocking your paper towels must be determined, then notified to remove an item from the available stock and package it up. Finally, the package must be routed through some combination of airplanes, trucks, and vans along with other packages in a way that ensures that all the packages will reach their destinations efficiently.

[ Also on InfoWorld: 10 best API management tools ]

Now imagine you had to coordinate all of these things as a customer. You’d never order paper towels because it’s too complicated and time consuming and you have better things to do. Luckily, the whole ordeal is abstracted away from you. There is a long, interconnected chain of computer systems and human processes that make those paper towels show up at your doorstep, but all you have to think about is pressing a button.

This is what APIs are like for programmers. They take an overwhelming amount of complexity and define a relatively simple set of interactions that you can utilize instead of doing it all yourself. In any software project, you’re likely using tens if not hundreds of APIs directly, and each of those APIs relies on other APIs and so on.

Public APIs and API integration

APIs are a longstanding concept in computer programming, and they have been part of developers’ toolsets for years. Traditionally, APIs were used to connect code components running on the same machine. With the rise of ubiquitous networking, more and more public APIs, sometimes called open APIs, have become available. Public APIs are outward facing and accessible over the Internet, allowing you to write code that interacts with other vendors’ code online; this process is known as API integration.

These kinds of code mashups allow users to mix and match functionality from different vendors on their own systems. For instance, if you use the marketing automation software Marketo, you can sync your data there with Salesforce CRM functionality.

“Open” or “public” should not be interpreted as meaning “free of charge” in this context. You still need to be a Marketo and Salesforce customer for this to work. But the availability of these APIs makes integration a much simpler process than it otherwise would be. (InfoWorld has a great list of public APIs you should know about.)

Web services and APIs

You might recall the term web services from the early ’00s and think that the idea of an open API sounds pretty similar. In fact, a web service is a specific kind of open API, one that meets a fairly rigid set of specifications, including that they be specified in Web Services Description Language (WSDL), an XML variant.

Web services were meant to be used as part of a service-oriented architecture (SOA). As the Nordic APIs blog explains, that gave web services something of a bad name, as SOAs never quite lived up to their potential. Advances in the techniques used for service-to-service communications—notably lighter, more flexible REST—have also left web services somewhat behind in the world of public APIs.

REST APIs

Web services were originally designed to communicate using SOAP (Simple Object Access Protocol), a messaging protocol that sends XML documents over HTTP. Today, however, most web-based APIs use REST—Representational State Transfer—as an architectural style.

REST was formally introduced by Roy Fielding in his doctoral dissertation in 2000. It’s a set of architectural components, design principles, and interactions used for building distributed systems that involve media of any kind (text, video, etc.). At its core, REST is a style of building systems that allows for flexible communication and display of information across the web while providing structure necessary to easily build general purpose components.

In a REST API, a resource could be pretty much anything, but examples include a user, a list of tweets, and the current results of a search for tweets. Each of these resources is addressable at a resource identifier, which in the case of web-based REST APIs is usually a URL, such as https://api.twitter.com/1.1/users/show?screen_name=twitterdev. When an application requests a resource using the identifier, the API delivers the current representation of that resource to the application in a format that the application can consume, such as a JPEG image, HTML page, or JSON.

[ Also on InfoWorld: What is CI/CD? Continuous integration and continuous delivery explained ]

One of the big differentiators of REST is that it involves sending data to the requesting application. While this provides great flexibility, allowing the application to do whatever it wants with the data, it comes at the cost of efficiency. Sending data over the web for processing is quite slow compared to doing the processing where the data resides and then sending the results.

Of course, the problem with the “efficient” approach is that systems hosting the data would need to know what applications want to do with it ahead of time. Thus, in order to build an API that has general purpose usability and flexibility, REST is the way to go.

API examples

There are plenty of public APIs out there for you to interact with, many from industry behemoths. The ability to access some platform company’s code programmatically via an API is what makes them a platform, in essence. Some prominent API examples include:

  • Google APIs, which allow you to connect your code to the whole range of Google services, from Maps to Translate. APIs are so important to Google that they acquired Apigee, a leading API management platform.
  • Facebook APIs, which allow you to programmatically access Facebook’s social graph and marketing tools. (The company has been restricting just what user data you can access via these APIs in the fallout from Cambridge Analytica and other scandals.)

To really get a sense of how APIs work, let’s do a deep dive into two: the Java API, which Java developers use to interact with the Java platform, and the Twitter API, a public API that you would use to interact with the social networking service.

The Java API

The Java API is a library of software components available “out of the box” to anyone who has installed the Java Development Kit. These components implement common tasks and generally increase productivity because programmers don’t have to start from scratch every time. One of the basic components used in software is something called a List, which, as you might expect, keeps track of a list of items. The Java API defines what you can do with a List: add items, sort the list, determine if an item is in the list, etc. It also specifies how to perform those actions. In order to sort the List, you need to specify how you want the List sorted: alphabetically, numerically descending, brightest to dullest color, etc.

The OpenJDK API documentation for the sort method of a List. The comparator is the parameter that determines how the list is sorted.

The Twitter API

The Twitter API is a web-based JSON API that allows developers to programmatically interact with Twitter data. Unlike the Java API, which is included in the Java Development Kit, the Twitter API is a web-based API. It must be accessed by making requests over the Internet to services that Twitter hosts.

With a web-based API such as Twitter’s, your application sends an HTTP request, just like a web browser does. But instead of the response being delivered as a webpage, for human understanding, it’s returned in a format that applications can easily parse. Various formats exist for this purpose, and Twitter uses a popular and easy-to-use format called JSON. (If you’re not familiar with JSON, you might want to spend a few minutes reading up on it here.)

One of the basic elements in Twitter is a tweet. The Twitter API tells you what you can do with tweets: search for tweets, create a tweet, favorite a tweet. It also tells you how to perform these actions. To search for tweets, you need to specify your search criteria: terms or hashtags to look for, geolocation, language, etc.

Twitter’s Search API documentation. Here you will find all of the details you need to query the universe of tweets, from the search operators available to the format of the responses.

API design

API design is the process by which the “what” and the “how” of an API are formulated. As with anything else that can be created, varying levels of thought and care are put into API design, resulting in varying levels of API quality. Well-designed APIs have consistent behavior, take their context into account, and keep the needs of their users in mind.

Consistent behavior within an API greatly impacts the speed at which it can be learned and the likelihood of programmers making mistakes when using it. Generally, APIs that perform similar actions should behave similarly, regardless of their technical differences. For an example of an inconsistent API, let’s look at the two ways to add an item to a List in Java:

Inconsistent APIs make life difficult for developers. An example: Java provides two methods to add an item to a List. One returns a boolean, and the other returns a void.

Even though the two methods of adding items to a list do the same thing, their return types (boolean and void) are different. Developers using this API now have to keep track of which method returns which type, making the API harder to learn and its usage more error prone. It also means the code that uses these methods becomes less flexible, because it has to change if you want to switch the way you’re adding elements.

Taking context into account is another form of consistency, although it has to do with factors external to the API. A great, non-software example of this is how the rule of the road—right hand traffic or left hand traffic—influences car designs for different countries. Car designers take that environmental factor into account when locating the driver seat on the right side or left side of the car.

Читайте также:  Архитектура oc windows имеет модульную структуру
Оцените статью