Dictionary of Meaning
<<Back
Please select a letter:
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
0-9
Click here for Shopping
Windows api
*** Shopping-Tip: Windows api
The '''Windows API''' is the name given by Microsoft to the core set of
application programming interfaces available in the
Microsoft Windows operating systems. It is designed for usage by
C programming language C/
C++ programs and is the most direct way to interact with a Windows system for
Application software software applications. Lower level access to a Windows system, mostly required for
device drivers, is provided by the
Windows Driver Model in current versions of Windows.
A
software development kit (SDK) is available for Windows, which provides documentation and tools to enable developers to create software using the Windows API and associated Windows technologies.
Overview of the Windows API Components
The functionality provided by the Windows API can be grouped into six categories:{{ref|msdn-overview}}
; Base Services{{ref|msdn-base}}: Provide access to the fundamental resources available to a Windows system. Included are things like
file systems,
:Category:Computer device devices,
Process (computing) processes and
Thread (computer science) threads, access to the
Windows registry, and
error handling. These functions reside in
kernel.exe,
krnl286.exe or
krnl386.exe files on 16-bit Windows, and
kernel32.dll and
advapi32.dll on 32-bit Windows.
; Graphics Device Interface{{ref|msdn-gdi}}: Provide the functionality for outputting graphical content to
monitors,
printers and other
output devices. It resides in
gdi.exe on 16-bit Windows, and
gdi32.dll on 32-bit Windows.
; User Interface{{ref|msdn-UI}}: Provides the functionality to manage
window (computing) windows and most basic controls, such as
button (computing) buttons and
scrollbars, receive mouse and keyboard input, and other functionality associated with the
GUI part of Windows. This functional unit resides in
user.exe on 16-bit Windows, and
user32.dll on 32-bit Windows. Since
Windows XP, the basic controls reside in
comctl32.dll, together with the common controls.
; Common Dialog Box Library{{ref|msdn-comdlg}}: Provides applications the standard
dialog boxes for opening and saving files, choosing color and font, etc. The library resides in a file called
commdlg.dll on 16-bit Windows, and
comdlg32.dll on 32-bit Windows. It is grouped under the ''User Interface'' category of the API.
; Common Control Library{{ref|msdn-ccl}}: Gives applications access to some advanced controls provided by the operating system. These include things like
status bars, progress bars,
toolbars and
tab (GUI) tabs. The library resides in a
Dynamic-Link Library DLL file called
commctrl.dll on 16-bit Windows, and
comctl32.dll on 32-bit Windows. It is grouped under the ''User Interface'' category of the API.
; Windows Shell{{ref|msdn-shell}}: Component of the Windows API allows applications to access the functionality provided by the
operating system shell, as well as change and enhance it. The component resides in
shell.dll on 16-bit Windows, and
shell32.dll and
shlwapi.dll on 32-bit Windows. It is grouped under the ''User Interface'' category of the API.
; Network Services{{ref|msdn-network}}: Give access to the various
Computer network networking capabilities of the operating system. Its sub-components include
NetBIOS,
Winsock,
NetDDE,
remote procedure call RPC and many others.
Web related APIs
The
Internet Explorer web browser also exposes many APIs that are often used by applications, and as such could be considered a part of the Windows API. Internet Explorer has been an integrated component of the operating system since
Windows 98, and provides web related services to applications{{ref|msdn-browser}}. Specifically, it provides:
* An embeddable web browser control, contained in
shdocvw.dll and
mshtml.dll.
* The URL monikers service, held in
urlmon.dll, which provides COM objects for applications to resolving URLs. Applications can also provide their own URL handlers for others to use.
* A library for assisting with multi-language and international text support (mlang.dll).
* DirectX Transforms, a set of image filter components.
* XML support (the MSXML components).
* Access to the Windows Address Book.
Multimedia related APIs
Microsoft provide the
DirectX set of APIs as part of every Windows installation. DirectX provides a loosely related set of multimedia and gaming services, including:
*
Direct3D as an alternative to OpenGL for access to 3D acceleration hardware.
*
DirectDraw for hardware accelerated access to the 2D framebuffer. This component has been deprecated as of DirectX 9.
*
DirectSound for low level hardware accelerated sound card access.
*
DirectInput for communication with input devices such as joysticks and gamepads.
*
DirectPlay as a multiplayer gaming infrastructure. This component has been deprecated as of DirectX 9 and Microsoft no longer recommends its use for game development.
*
DirectShow which builds and runs generic multimedia pipelines. It is comparable to the
GStreamer framework and is often used to render in-game videos and build media players (
Windows Media Player is based upon it). DirectShow is no longer recommended for game development.
*
DirectMusic
APIs for interaction between programs
The Windows API mostly concerns itself with the interaction between the Operating System and an application. For communication between the different Windows applications among themselves, Microsoft has developed a series of technologies alongside the main Windows API. This started out with
Dynamic Data Exchange (DDE), which was superseded by
Object Linking and Embedding (OLE) and later by the
Component Object Model (COM).
Wrapper Libraries
Various
wrappers were developed by Microsoft that took over some of the more low level functions of the Windows API, and allowed applications to interact with the API in a more abstract manner.
Microsoft Foundation Classes (MFC) wrapped Windows API functionality in
C++ Class (computer science) classes, and thus allows a more
Object-oriented programming object oriented way of interacting with the API. The Active Template Library (ATL) is a
template oriented wrapper for COM. The
Windows Template Library (WTL) was developed as an extension to ATL, and intended as a lightweight alternative to MFC.
Also notable are some of
Borland Borland's offerings.
Object Windows Library (OWL) was released as a competing product to MFC, and offered a similar object-oriented wrapper. Borland later
deprecation deprecated it in favour of the
Visual Component Library.
History
The Windows API has always exposed a large part of the underlying structure of the various Windows systems for which it has been built to the programmer. This has had the advantage of giving Windows programmers a great deal of flexibility and power over their applications. However, it also has given Windows applications a great deal of responsibility in handling various low-level, sometimes tedious, operations that are associated with a
Graphical user interface.
Charles Petzold, writer of various well read Windows API books, has said:{{ref|petzold-47}}
{{Quotation|The original hello-world program in the Windows 1.0 SDK was a bit of a scandal. HELLO.C was about 150 lines long, and the HELLO.RC resource script had another 20 or so more lines. (...) Veteran C programmers often curled up in horror or laughter when encountering the Windows hello-world program.|
Charles Petzold|Programming Microsoft Windows with C#}}
A
hello world program#Windows API (in C) hello world program is a frequently used programming example, usually designed to show the easiest possible application on a system that can actually do something (i.e. print a line that says "Hello World").
Over the years, various changes and additions were made to the Windows Operating System, and the Windows API changed and grew to reflect this. The Windows API for
Windows 1.0 supported fewer than 450
Subroutine function calls, where in modern versions of the Windows API there are thousands. However, in general, the interface remained fairly consistent, and an old Windows 1.0 application will still look familiar to a programmer who is used to the modern Windows API.{{ref|petzold-9}}
A large emphasis has been put by
Microsoft on maintaining software
backwards compatibility. To achieve this, Microsoft sometime even went as far as supporting software that was using the API in a undocumented or even (programmatically) illegal way.
Raymond Chen, a Microsoft developer who works on the Windows API, has said that he:{{ref|chen-bozos}}
{{Quotation|could probably write for months solely about bad things apps do and what we had to do to get them to work again (often in spite of themselves). Which is why I get particularly furious when people accuse Microsoft of maliciously breaking applications during OS upgrades. If any application failed to run on Windows 95, I took it as a personal failure.|
Raymond Chen|What about BOZOSLIVEHERE and TABTHETEXTOUTFORWIMPS?}}
One of the largest changes the Windows API underwent was the transition from Win16 (shipped in Windows 3.1 and older) to Win32 (Windows NT and Windows 95 and up). While
Win32 was originally introduced with
Windows NT 3.1 and
Win32s allowed usage of a Win32 subset before Windows 95, it was not until this release (which introduced massive changes at every level of the API) that manyapplications began being ported to Win32. To ease the transition, in Windows 95, both for external developers and for Microsoft itself, a complex scheme of API thunks was used that could allow 32 bit code to call into 16 bit code and (in limited cases) vice-versa. So-called ''flat thunks'' allowed 32 bit code to call into 16 bit libraries, and the scheme was used extensively inside Windows 95 to avoid porting the whole OS to Win32 itself in one chunk. In Windows NT, the OS was pure 32-bit (except the parts for compatiblity with 16-bit applications) and the only thunk available was generic thunks which only thunks from Win16 to Win32 and worked in Windows 95 too. The Platform SDK shipped with a compiler that could produce the code necessary for these thunks.
Versions
Almost every new version of Microsoft Windows has introduced its own additions and changes to the Windows API. {{ref|win32faq-history}} The name of the API however was kept consistent between different Windows version, and name changes were kept limited to major architectural and platform changes for Windows. Microsoft eventually changed the name of the then current Win32 API family into Windows API, and made it into a catch-all term for both past and future versions of the API. {{ref|msdn-overview2}}
* '''Win16''' was the API for the first,
16-bit versions of
Microsoft Windows. These were initially referred to as simply the Windows API, but were later renamed to Win16 in an effort to distinguish it from the newer, 32-bit version of the Windows API. The functions of Win16 API mainly reside in the core files of the OS: ''kernel.exe'' (or ''krnl286.exe'' or ''krnl386.exe''), ''user.exe'' and ''gdi.exe''. Despite the
file extension of
exe, these actually are
dynamically linked library dynamically linked libraries.
* '''Win32''' is the
32-bit Application programming interface API for modern versions of Windows. The API consists of functions implemented, as with Win16, in system DLLs. The core DLLs of Win32 are
kernel32.dll,
user32.dll, and
gdi32.dll. Win32 was introduced with
Windows NT. The version of Win32 that was shipped with
Windows 95 was initially referred to as Win32c, with the 'c' standing for 'compatibility', but this term was later abandoned by Microsoft in favour of Win32.
* '''
Win32s''' is an extension for the
Windows 3.x#Windows 3.1 Windows 3.1x family of Microsoft Windows that implemented a
subset of the Win32 API for these systems. The 's' stands for 'subset'.
* '''Win32 for 64-bit Windows''', previously known as '''Win64''', is the version of the API targeted for
64-bit versions of Windows - namely,
Windows XP Professional x64 Edition and Windows Server 2003 x64 Edition (for
AMD64 processors) and Windows XP 64-bit Edition and Windows Server 2003 for
Itanium-series. The 64-bit versions are just two more
Windows NT#Supported platforms supported platforms within
Architecture of the Windows NT operating system line#Hardware abstraction layer Windows NT architecture so both 32-bit and 64-bit versions of an application can still be compiled from single
code base. All memory
pointers are 64-bit by default though, so the source code has to be checked for compatibility with 64-bit
pointer arithmetic and rewritten as necessary. There are no new functions specific to 64-bit versions of Windows.
* '''
WinFX''' is a new
object oriented API, that "embraces and extends" the
.NET Framework Microsoft .NET platform. It is designed to give software applications access to the full range of features available in
Windows Vista. Like .NET applications, WinFX applications will run as so-called
managed code on the
Common Language Runtime, a
virtual machine that runs on top of the Windows API. {{ref|msdntv-winfx}} The GUI API set for WinFX is called the
Windows Presentation Foundation and requires high-end graphics cards to properly render some effects.
Other implementations
Although Microsoft's implementation of the Windows API is copyrighted, it is generally accepted that other vendors can emulate Windows by providing an identical API, without breaching copyright.
The
Wine (software) Wine project is an attempt to provide a Win32 API
Compatibility layer for
Unix-like platforms.
ReactOS goes a step further and provides an emulation of the entire Windows operating system, working closely with the Wine project to promote code re-use and compatibility.
Mono development platform The Mono Project implements much of the .NET Framework and the C# programming language.
Compiler support
To develop software that utilizes the Windows API, a compiler must be able to handle and import the Microsoft-specific DLLs and COM-objects. The compiler must accept a C or C++ language dialect and handle
Interface description language IDL (interface definition language) files and header files that expose the interior API function names. Collectively, these prerequisites (compilers, tools, libraries, and headers) are known as the Windows ''Platform
SDK.'' For a long time the proprietary
Microsoft Visual Studio family of
compilers and tools and
Borland's compilers were the only tools that could provide this (although at least in the case of Windows, the SDK itself is downloadable for free separately from the entire
IDE suite, from [http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm Microsoft Platform SDK Update]). Nowadays the
MinGW and
Cygwin projects also provide such an environment based on the
GNU Compiler Collection, using a stand-alone header file collection to make linking against Microsoft DLLs possible.
LCC-Win32 is a "free for non-commercial use" C compiler maintained by Jacob Navia (a comp.lang.c regular). [http://www.masm32.com/ Masm32] is a mature project to support the Windows API utilizing the 32 bit Microsoft assembler with custom made or converted headers and libraries from the Platform SDK.
Windows specific compiler support is also required for the
Exception handling Structured Exception Handling feature (SEH). This system serves a dual purpose: it provides a substrate upon which language-specific exception handling can be implemented, and it is how the kernel notifies applications of exceptional conditions such as dereferencing an invalid pointer or stack overflow. The Microsoft/Borland C++ compilers had the ability to use this system as soon as it was introduced in Windows 95 and NT, however the actual implementation was undocumented and had to be reverse engineered for the Wine project and free compilers. SEH is based on pushing exception handler frames onto the stack, then adding them to a linked list stored in thread local storage (the first field of the thread environment block). When an exception is thrown, the kernel and base libraries unwind the stack running handlers and filters as they are encountered. Eventually, every exception unhandled by the application itself will be dealt with by the default backstop handler which pops up the Windows common crash dialog.
Example of API implementation in
Visual Basic: (this shortened example causes the Command button to be able to be moved around on the form by the user)
Private Const WM_NCLBUTTONDOWN As Long = &HA1&
Private Const HTCAPTION As Long = 2&
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd&, ByVal wMsg&, wParam As Any, lParam As Any) As Long
If Command1.MousePointer = 14 Then
Call ReleaseCapture
Call SendMessage(Command1.hWnd, WM_NCLBUTTONDOWN, ByVal HTCAPTION, ByVal 0&)
End If
See also
*
WinFX
*
Win32 console
*
Interix
Notes
# {{note|msdn-overview}}
Microsoft Developer Network (July 2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/overview_of_the_windows_api.asp Overview of the Windows API.]'' Retrieved August 28, 2005.
# {{note|msdn-base}}
Microsoft Developer Network (July 2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/base_services.asp Base Services.]'' Retrieved August 28, 2005.
# {{note|msdn-gdi}}
Microsoft Developer Network (July 2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/graphics_device_interface.asp Graphics Device Interface.]'' Retrieved August 28, 2005.
# {{note|msdn-UI}}
Microsoft Developer Network (July 2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/user_interface.asp User Interface.]'' Retrieved August 28, 2005.
# {{note|msdn-comdlg}}
Microsoft Developer Network (2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/commondialogboxlibrary.asp Common Dialog Box Library.]'' Retrieved September 22, 2005.
# {{note|msdn-ccl}}
Microsoft Developer Network (July 2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/common_control_library.asp Common Control Library.]'' Retrieved August 28, 2005.
# {{note|msdn-shell}} ''See:''
#*
Microsoft Developer Network (July 2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/windows_shell.asp Windows Shell.]'' Retrieved August 28, 2005.
#*
Microsoft Developer Network (2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_intro.asp Shell Programmer's Guide.]'' Retrieved August 28, 2005.
# {{note|msdn-network}}
Microsoft Developer Network (July 2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/network_services.asp Network Services.]'' Retrieved August 28, 2005.
# {{note|msdn-browser}}
Microsoft Developer Network (January 2006). ''[http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/prog_browser_node_entry.asp Programming and reusing the browser]'' Retrieved January 22, 2006.
# {{note|petzold-47}}
Charles Petzold (December 2001). ''Programming Microsoft Windows with C#.'' Microsoft Press. Beyond the Console, page 47.
# {{note|petzold-9}}
Charles Petzold (November 11, 1998). ''Programming Windows, Fifth Edition.'' Microsoft Press. APIs and Memory Models, page 9.
# {{note|chen-bozos}}
Raymond Chen (October 15, 2003). ''[http://blogs.msdn.com/oldnewthing/archive/2003/10/15/55296.aspx What about BOZOSLIVEHERE and TABTHETEXTOUTFORWIMPS?]'' Retrieved August 27, 2005.
# {{note|win32faq-history}} The Iseran Project (1996-2001). ''[http://www.iseran.com/Win32/FAQ/history.html History of the Windows API.]'' Retrieved October 7, 2005.
# {{note|msdn-overview2}}
Microsoft Developer Network (July 2005). ''[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/overview_of_the_windows_api.asp Overview of the Windows API.]'' Retrieved August 28, 2005.
# {{note|msdntv-winfx}} Brad Abrams (November 7, 2003). ''[http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20031107winfxba/manifest.xml What is WinFX -The New Programming Interface Introduced in Windows "Longhorn".] ([http://msdn.microsoft.com/msdntv/transcripts/20031107WINFXBATranscript.aspx transcript])''
Microsoft Developer Network MSDN TV. Retrieved October 7, 2005.
References
#
Diomidis Spinellis. [http://www.spinellis.gr/pubs/jrnl/1997-CSI-WinApi/html/win.html A critique of the Windows application programming interface]. ''Computer Standards & Interfaces'', 20(1):1–8, November 1998. [http://dx.doi.org/10.1016/S0920-5489(98)00012-9 doi:10.1016/S0920-5489(98)00012-9].
External links
-
Microsoft Developer Network Windows API development guide
-
Catch22 Tutorials Well documented, gorgeous, Win32 API tutorials for developing small, nifty, and efficient programs in Windows.
-
Wikibooks:Windows Programming
-
Inside the Native API
-
theForger's Win32 API Tutorial
-
Glowdot's Win32/C++ tutorial
-
The Old New Thing Weblog by Microsoft developer
Raymond Chen, who works on the Windows API and posts extensively about it.
-
pinvoke.net: the interop wiki! PINVOKE.NET attempts to address the difficulty of calling Win32 or other unmanaged APIs in managed code (languages such as C# and VB .NET).
Category:Application programming interfaces
Category:Microsoft Windows
Category:Microsoft APIs
da:Windows API
de:WinAPI
es:API de Windows
it:Windows API
ja:Windows API
pl:Win32
ru:Windows API
see
Windows API
*** Shopping-Tip: Windows api