Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Windows API
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==History== The Windows API has always exposed a large part of the underlying structure of the Windows systems to programmers. This had the advantage of giving them much flexibility and power over their applications, but also creates great responsibility in how applications handle various low-level, sometimes tedious, operations that are associated with a [[graphical user interface]]. For example, a beginning C programmer will often write the simple "hello world" as their first assignment. The working part of the program is only a single printf line within the main subroutine. The overhead for linking to the standard I/O library is also only one line: {{Wikibooks|Computer Programming|Hello world#Windows API (in C)}} <syntaxhighlight lang="c">#include <stdio.h> int main(void) { printf("Hello, World!\n"); }</syntaxhighlight> [[Charles Petzold]], who wrote several books about programming for the Windows API, said: "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 programmers often curled up in horror or laughter when encountering the Windows hello-world program."<ref name="petzold-47">[[Charles Petzold]] (December 2001). ''Programming Microsoft Windows with C#''. Microsoft Press. Beyond the Console, page 47.</ref> Petzold explains that while it was the first Windows sample programs developers were introduced to, it was quite "fancy" and more complex than needed. Tired of people ridiculing the length of the sample, he eventually reduced it to a simple MessageBox call.<ref>{{Cite web |last=Petzold |first=Charles |title=The Infamous Windows "Hello World" Program |url=https://www.charlespetzold.com/blog/2014/12/The-Infamous-Windows-Hello-World-Program.html |access-date=2024-06-30 |website=www.charlespetzold.com |language=en}}</ref> Over the years, various changes and additions were made to Windows systems, and the Windows API changed and grew to reflect this.<ref name="winapi-changes">''[http://abi-laboratory.pro/index.php?view=winapi Detailed analysis of changes in the Windows API from XP to 10.]'' Retrieved September 08, 2016.</ref> The Windows API for [[Windows 1.0]] supported fewer than 450 [[Subroutine|function calls]], whereas modern versions of the Windows API support 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 name="petzold-9">[[Charles Petzold]] (November 11, 1998). ''Programming Windows, Fifth Edition''. Microsoft Press. APIs and Memory Models, page 9.</ref> Microsoft has made an effort to maintain [[backward compatibility]]. To achieve this, when developing new versions of Windows, Microsoft sometimes implemented workarounds<ref>{{cite web |last1=Smith |first1=Graham |title=Windows 95 had special code just to fix a bug in the original SimCity |url=https://www.rockpapershotgun.com/windows-95-had-special-code-just-to-fix-a-bug-in-the-original-simcity |website=Rock, Paper, Shotgun |language=en |date=8 October 2022}}</ref> to allow compatibility with third-party software that used the prior version in an undocumented or even inadvisable way. [[Raymond Chen (Microsoft)|Raymond Chen]], a Microsoft developer who works on the Windows API, has said: "I 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."<ref name="chen-bozos">[[Raymond Chen (Microsoft)|Raymond Chen]] (October 15, 2003). ''[https://devblogs.microsoft.com/oldnewthing/20031015-00/?p=42163 What about BOZOSLIVEHERE and TABTHETEXTOUTFORWIMPS?]'' Retrieved June 29, 2022.</ref> One of the largest changes to the Windows API 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 use of a Win32 subset before Windows 95, it was not until Windows 95 that widespread porting of applications to Win32 began. To ease the transition, in Windows 95, for developers outside and inside Microsoft, a complex scheme of API [[thunk (compatibility mapping)|thunks]] was used that could allow 32-bit code to call into 16-bit code (for most of Win16 APIs) and vice versa. ''Flat thunks'' allowed 32-bit code to call into 16-bit libraries, and the scheme was used extensively inside Windows 95's libraries to avoid porting the whole OS to Win32 in one batch. In Windows NT, the OS was pure 32-bit, except parts for compatibility with 16-bit applications, and only generic thunks were available to thunk from Win16 to Win32, as for Windows 95. The Platform SDK shipped with a compiler that could produce the code needed for these thunks. Versions of 64-bit [[Windows]] are also able to run 32-bit applications via [[WoW64]]. The SysWOW64 folder located in the Windows folder on the OS drive contains several tools to support 32-bit applications.<ref>{{Cite web |last=Hoffman |first=Chris |title=What's the Difference Between the "System32" and "SysWOW64" Folders in Windows? |url=https://www.howtogeek.com/326509/whats-the-difference-between-the-system32-and-syswow64-folders-in-windows/ |access-date=2023-04-11 |website=How-To Geek |date=February 16, 2018 |language=en-US}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)