The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Why does Windows wait longer than my screen saver idle timeout before starting the screen saver?
You may find yourself in a situation where Windows takes longer than your specified screen saver idle timeout to start the screen saver. First of all, there are ways for programs to block the screen saver entirely. Calling , is how a program says, "Even though there is no mouse or keyboard input, the screen is indeed in use, so don't blank it or start the screen saver." Media playback programs use this so the screen saver doesn't kick in while you're watching a movie on your DVD, and presentation programs use it so the screen saver doesn't start in the middle of your multi-million-dollar proposal. But even if n...
There’s no law that says a meeting can’t end early
If you're finished early, then finish early.
Microspeak: Action on
I have been fortunate to have been spared exposure to this particular corner of Microspeak, but others have not been so lucky. Have you actioned on this ask? It's not clear whether actioning on something means that you've started it or you've finished it. As a result, this is another case of using jargon to impede communication. The inventors of this particular form of Microspeak must be proud of themselves, for not only have they verbed a noun, they coupled it with an unnecessary preposition. But they aren't content to stop there. It wasn't long before the noun that got verbed got re-nouned! Here is our l...
The format rectangle is recalculated whenever the window resizes, and that's a good thing
Reader asmguru62 asks why a custom format rectangle of a multi-line edit control is lost when the edit control is resized. That's right, the format rectangle is recalculated whenever the window resizes, and that's a good thing. Imagine if it weren't recalculated. You create a multi-line edit control. Like many programs, you might create it at a temporary size while you try to figure out what its real size should be. You might even resize the control dynamically as the container is resized. (After all, everybody wants resizable dialogs.) What you definitely don't want is the format rectangle of the edit control...
It's not just on the Internet that nobody knows you don't have a real office
Sure, your company don't have an office, but that's okay. You can rent a fake one, with a fake receptionist, fake staff, and fake conference rooms, and whenever somebody stops by asking for you, the receptionist is trained to say that you're "out".
Why can't I declare a type that derives from a generic type parameter?
A lot of questions about C# generics come from the starting point that they are just a cutesy C# name for C++ templates. But while the two may look similar in the source code, they are actually quite different. C++ templates are macros on steroids. No code gets generated when a template is "compiled"; the compiler merely hangs onto the source code, and when you finally instantiate it, the actual type is inserted and code generation takes place. This is a perfectly legal (if strange) C++ template class. But when the compiler encounters this template, there are a whole bunch of things left unknown. What is th...
Landing the Space Shuttle is hard enough as it is
I was at The Museum of Flight and was waiting my turn at the Space Shuttle landing simulator. A six-year-old settled into the control seat, and as the simulation began I heard him ask his father, "Where are the bad guys?" I'm pretty sure the Space Shuttle doesn't come with onboard missiles. That didn't stop the kid from pressing the trigger on the joystick a lot, though. By the way, I cratered the Space Shuttle.
Common gotchas when writing your own p/invoke
If you're looking to get into some p/invoke action, you'd be well-served to check out the pinvoke wiki to see if somebody else has done it too. If what you need isn't there, you may end up forced to write your own, and here are some gotchas I've seen people run into: C++ and Win32 are not the same as C# (aka ). In Win32, is a 4-byte type, and is a 1-byte type. [See also MadQ's remarks about .] Meanwhile, C++ is not standardized by Win32, so the size will vary based on your compiler, but most compilers use a 1-byte value. And then C# is even weirder: T...
The wisdom of sev^H^H^Heighth graders: What it means to be an adult
Since I'm obviously a glutton for punishment, I also helped read eighth grade essays on the same topic: Describe the qualities you consider to be those which make someone an adult. As always, remember that these are just the funny sentences/excerpts. Let me tell you about my parents Entering a no fun zone It's harder than I thought Tautology corner Assorted commentary Misspelling corner. I've included more context; that may make the game a bit easier. And just so you won't think all eighth graders are terrible writers: