The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
On the unanswerability of the maximum number of user interface objects a program can create
The answer to the question "What is the maximum number of window classes a program can register?" is not a number. Most user interface objects come from a shared pool of memory known as the "desktop heap". Although one could come up with a theoretical maximum number of window classes that can fit in the desktop heap, that number is not achievable in practice because the desktop heap is shared with all other user interface objects on the desktop. For example, menus and windows go into the desktop heap, as well as more obscure objects like active window enumerations, window positioning handles used by , and even h...
The wisdom of seventh graders: Contributions to class discussion
(In the continuing sporadic series on the wisdom of seventh grade students.) My friend the seventh grade teacher once had to deal with a class that had gotten out of hand by assigning the students a short essay in which they had to address three questions: One of the more disruptive students answered the questions thus:
The dialog class goes under the sneaky name WC_DIALOG
An anonymous commenter wanted to know how to create a dialog box with . The window class for dialog boxes is . I'm not quite sure why anybody would want to create a dialog box this way, but there you have it.
How do you wash soap?
Steve Makofsky wondered, "How do you throw out a garbage can?". Along similar lines, I always wondered how you washed soap.
If you work at a company, it's not your computer any more
My posting a while back on solving one problem by creating a bigger problem was written from the standpoint of an IT department doing something like tweaking a logon script. I even mentioned that context partway through but clearly didn't highlight it clearly enough. So say you're an IT department and somebody says, "Oh, just install this other program and learn a new programming language and convert your existing batch file to it, and then your problem will be easy to solve." You might not be too excited about that type of "solution". And even if you decide, "Okay, I can justify to my boss taking a week away f...
As I recall, Germany did not ratify the United States Constitution
I remember reading a news report on a court case wherein the defendant claimed protection under the First Amendment of the United States Constitution. An interesting angle, especially since the case was being tried in Germany under German law. I may be wrong, but it is my impression that Germany did not ratify the United States Constitution. There's actually a point to this anecdote. Occasionally, when someone notes that Windows doesn't do one thing or another thing for legal reasons, people will post comments saying something like, "Well, a German court ruled that XYZ is legal, so your reason is bogus." Or, "...
How did "Start Me Up" become the theme for the Windows 95 launch?
Add this to your trivia pile. Keith Combs links to a pair of articles that that go into the history behind how Start Me Up become the theme for the Windows 95 launch. Part 1, Part 2.
Try to avoid having BOOL function parameters
Generally speaking, I believe that you should try to avoid giving functions a boolean parameter (, , etc.) unless the meaning of that boolean parameter is blatantly obvious. Examples of obvious meaning would be the second parameter to the function ( obviously means the window is being enabled and means that it's being disabled) and the final parameter to ( obviously means the scroll bar is being shown and means that it's being hidden). In both of these cases, the meaning of the boolean parameter is encoded in the name of the function itself. But for functions like , what does that first parameter mean? Firs...
We know it's insecure, but we want to do it anyway
I remember a question from somebody who asked, paraphrasing: We're writing a secure screen saver that the user can interact with. We're going to present the user with various types of information, and if they click on a hot link, we want to launch a web page on their desktop once the user unlocks the workstation. We know it's insecure, but we want to do it anyway. Apparently these people didn't get the memo on security. Windows tries to make it hard for you to do this to a secure screen saver. The restrictions on secure screen savers have gotten tighter over time. Originally, secure screen savers were isolate...