December 20th, 2010

What happened to the return code from WinMain in 16-bit Windows?

Commenter S asks, “What happened to the return code from WinMain in a Windows 3.1 app?” After all, there was no GetExitCodeProcess function in 16-bit Windows. Basically, the exit code vanished into the ether. Unless you captured it. The Toolhelp library provided a low-level hook into various parts of the kernel, allowing you to monitor, among other things, the creation and destruction of tasks. That was how you captured the return code of a Windows program in 16-bit Windows.

But if you didn’t catch it as it happened, it was gone forever, lost in the ether.

Topics
History

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.