WM_CLOSE
message. Specifically, he revealed that if you intercepted the message but failed to handle it, the application would simply not close. Like, at all. He then proceeded to issue a casual challenge: if anyone could think up a use for this little loophole, to send him an email about it.Well, I did. On both counts. I don't have the email I sent him anymore, so we'll just focus on the use of the message loophole, since that's more interesting anyways.
I'll first set the stage by explaining that my AP Computer Science class was taught by my math teacher, Mrs. Simes, who had to have seriously been like 60 years old at the time. In the years since, I have grown to pity her and even appreciate the effort she put in trying to teach out of a book while attempting to stay at least a chapter ahead of her students. Of course, at the time I held pretty much nothing but contempt for this wizened old lady attempting to teach me things I had learned two years ago on my own. The fact that she was also my math teacher, and I hated math (still do, mostly) didn't help matters in the slightest. So here I am, stuck in this AP class bored out of my skull listening to Simes bumbling along and cooperating as best I could only because my lack of interest in school in general meant that this AP course would probably be the main thing that lets me graduate high school.
Okay so, back to the
WM_CLOSE
message. Upon learning of this feature, I immediately created a Win32 application that implemented it. Sure enough, no matter what I tried (Esc, Alt+F4, context menu, Close button) the window failed to respond and just sat there. Ctrl+Alt+Del was the only solution. I'd like to think that at this point I laughed maniacally and rubbed my hands together with manic glee - so I'll just say that's what I did. The next question was where to unleash this wonderful weapon of doom and who to target specifically, since it would need to be placed on a certain computer. Well, the where was pretty obvious: the AP CS class was just ripe for pranks. This narrowed down the who significantly since the classes were small and many of the students were actually technically savvy (whodathunk?). So of the few students who did not have any real technical know-how, I of course chose the most volatile. I won't mention her name here but her initials are Lisa T. (I wimped out and kept her full last name private. I must be getting nice in my old age)And let's just pause for a second here so I can say that I held no ill will in particular towards Lisa - she was just the ideal candidate for my prank. Sorry Lisa.
Sort of.
Right, so with my target chosen I had to properly spruce up my weapon, which I did by including message handlers for pressing the Esc key, exiting via the context menu, pressing Alt+F4, clicking the Close button and even pressing Q and X. All these handlers pointed towards a dialog box which read from a resource of messages that became incrementally more taunting as the user (target) tried more and more means of attempting to close this window. I then made the window start up by filling the entire width and height of the screen. Then I removed the Minimize and Restore buttons. Finally, I gave everyone a fair warning by titling the window "The Window That REALLY Won't DIE". Just as I thought I was done my plan took an even more devious turn, and I added a dialog box to pop up when the program is first run - but more on that later.

Weapon completed, I then had to assemble my delivery system. Fortunately, we all had assigned computers, so I knew which computer Lisa would be logging into. Unfortunately, she had class in a different period than me so I had to recruit an evil sidekick, my friend Andrew Owendoff. I gave Andrew a disk with the program executable on it and he walked into class early, turned on Lisa's computer, inserted and copied over the file to a specific and highly strategic location, ran the app, cleared the opening dialog box, and then turned off her computer monitor.
Showtime. (Note that the following is based on second-hand reports from Andrew since I couldn't (unfortunately - dammit!) be present, with minor dramatization for effect)
Poor unassuming Lisa comes to class and turns on her computer monitor. Lisa: Oh my! What is this window on my screen? Oh well, no matter, just shrug and hit Close... wait... wait what? Why is this message telling me I never learn? Oh well just close this and... why is this window still open?? I must have made a mistake. Click on Close and... another message?!? What's happening? Help! Mrs. Simes help!!
Over toddles Mrs. Simes, who squints through her bifocals at the screen and suggests "Well why don't you hit the Close button". Oh yes. Fabulous success!! The pair continue to be taunted by the application as Mrs. Simes grows increasingly confounded and poor Lisa reportedly just resorts to crying. Finally Simes gets completely fed up and simply restarts the computer. However, due to my foresight and the aforementioned strategic location in which the executable was placed, upon the restart of Windows a message box pops up:

Yes. I had Andrew place the program in the Startup folder. I know. Genius. Erm, evil genius, that is.
The next step was of course to call down the school's network and computer supervisor, who seriously didn't know much more than poor old Mrs. Simes. Some time later and after continuous frustration from trying to eradicate this program from the computer or even close it, they turned at last to their final remaining option: Consultation of the student who was rolling around on the floor laughing hysterically, who just so happened to share the same name as me. Coincidence? They thought not. After threatening Andrew with suspension he finally gave up that you have to task-kill the application and that he theorized the executable was in the Startup folder. However he maintained he didn't know how it got there or who had put it there.
I remember when I stepped into class a few periods later Mrs. Simes made a beeline for my desk, but my "who, me?" face had been well-practiced over the years of my youth, and so I was never officially fingered as the culprit and the crime passed on into the annals of legend.
Best of all? I still have that application thanks to my pack rat nature. If you'd like a gander, feel free to download it (with source) and use it for whatever diabolical plans you come up with - don't forget to write me letters from federal prison either. Swear I'll write back. If I'm inside at the time we can do lunch.
[lol]
~Jonathan