Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
6 user(s) are online (4 user(s) are browsing encyclopedia)

Members: 0
Guests: 6

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

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/C plus plus programs and is the most direct way to interact with a Windows system for Application software. 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:

(in alphabetical order)

  • Base Services
  • Common Control Library
  • Graphics Device Interface
  • Network Services
  • User Interface
  • Windows Shell
  • Base Services provide access to the fundamental resources available to a Windows system. Included are things like . These functions reside in kernel.exe or krnl386.exe files on 16-bit Windows, and kernel32.dll and advapi32.dll on 32-bit Windows.

    The Graphics Device Interface provides 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.

    The User Interface part of the Windows API provides the functionality to manage Window (computing) and most basic controls, such as Button (computing) and scrollbar, receive mouse and keyboard input, and other functionality asociated with the GUI part of Windows. This functional unit resides in user.exe on 16-bit Windows, and user32.dll on 32-bit Windows.

    The Common Dialog Box Library 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.

    The Common Control Library gives applications access to some advanced controls provided by the operating system. These include things like status bars, progress bars, toolbar and Tab (GUI). The library resides in a Dynamic-Link Library 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.

    The Windows 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 give access to the various Computer network capabilities of the operating system. Its sub-components include NetBIOS, Winsock, NetDDE, RPC and many others.

    ==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 plus plus Class (computer science), and thus allows a more Object-oriented programming 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 s offerings. Object Windows Library (OWL) was released as a competing product to MFC, and offered a similar object-oriented wrapper. Borland later 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.

    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 then 450 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.

    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 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.

    =Versions=

    Almost every new version of Microsoft Windows has introduced its own additions and changes to the Windows API. 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.

  • Win16 was the API for the first, .
  • Win32 is the 32-bit Application programming interface 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 family of Microsoft Windows that implemented a subset of the Win32 API for these systems. The s stands for subset .
  • Win64 is the 64-bit version of Win32, which includes extension functions for use on 64-bit computers. The Win64 API is found only on 64-bit versions of Windows XP and Windows Server 2003.
  • WinFX is a new object oriented API, that embraces and extends the 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. The GUI API set for WinFX is called the Windows Presentation Foundation and requires high-end graphics cards to properly render some effects.
  • The Wine (software) project is an attempt to provide a Win32 API Compatibility layer for Unix-like platforms, while Mono development platform implements much of the .NET Framework and the C# programming language.

    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.

    =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 is a free for non-commercial use C compiler maintained by Jacob Navia (a comp.lang.c regular).

    =See also=

  • DirectX
  • Microsoft .NET
  • Win32 console
  • Interix
  • =Notes=

    # Microsoft Developer Network (July 2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/overview_of_the_windows_api.asp Overview of the Windows API.] Retrieved August 28, 2005. # Microsoft Developer Network (July 2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/base_services.asp Base Services.] Retrieved August 28, 2005. # Microsoft Developer Network (July 2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/graphics_device_interface.asp Graphics Device Interface.] Retrieved August 28, 2005. # Microsoft Developer Network (July 2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/user_interface.asp User Interface.] Retrieved August 28, 2005. # Microsoft Developer Network (2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winui/winui/windowsuserinterface/userinput/commondialogboxlibrary.asp Common Dialog Box Library.] Retrieved September 22, 2005. # Microsoft Developer Network (July 2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/common_control_library.asp Common Control Library.] Retrieved August 28, 2005. # See: #* Microsoft Developer Network (July 2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/windows_shell.asp Windows Shell.] Retrieved August 28, 2005. #* Microsoft Developer Network (2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/shellcc/platform/shell/programmersguide/shell_intro.asp Shell Programmer s Guide.] Retrieved August 28, 2005. # Microsoft Developer Network (July 2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/network_services.asp Network Services.] Retrieved August 28, 2005. # Charles Petzold (December 2001). Programming Microsoft Windows with C#. Microsoft Press. Beyond the Console, page 47. # Charles Petzold (November 11, 1998). Programming Windows, Fifth Edition. Microsoft Press. APIs and Memory Models, page 9. # 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. # The Iseran Project (1996-2001). [http://www.iseran.com/Win32/FAQ/history.html History of the Windows API.] Retrieved October 7, 2005. # Microsoft Developer Network (July 2005). [http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/overview_of_the_windows_api.asp Overview of the Windows API.] Retrieved August 28, 2005. # Brad Abrams (November 7, 2003). [http://msdn.microsoft.com/msdntv/episode.aspxxml=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 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):18, November 1998. [http://dx.doi.org/10.1016/S0920-5489(98)00012-9 doi:10.1016/S0920-5489(98)00012-9].

    =External links=

    *[http://msdn.microsoft.com/library/default.aspurl=/library/en-us/winprog/winprog/windows_api_start_page.asp Microsoft Developer Network Windows API development guide] *[http://wikibooks.org/wiki/Programming:Windows_Programming Wikibooks:Windows Programming] *[http://www.iseran.com/Win32/FAQ/faq.htm Frequently Asked Questions About Win32 Programming] by the Iseran Project. *[http://www.sysinternals.com/ntw2k/info/ntdll.shtml Inside the Native API] *[http://www.winprog.net/tutorial/ theForger s Win32 API Tutorial] *[http://code.glowdot.com/tutorials/win32tutorial.phppage=1 Glowdot s Win32/C++ tutorial] *[http://blogs.msdn.com/oldnewthing/ The Old New Thing] Weblog by Microsoft developer Raymond Chen, who works on the Windows API and posts extensively about it. *[http://pinvoke.net 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).