The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
One engineer's interpretation of the Segway as a hybrid vehicle
In a discussion of commuting options (in which I was primarily an observer), the following exchange took place: A: I would rather get kicked in the shins every morning than bike up the massive hill that sits between my apartment and main campus. B: Have you tried an electric bike? C: If you're going to eliminate pedaling, then you may as well go all the way and get a Segway. B: Actually, I used to own a Segway. I was floored by the engineering achievement of creating a device that combined the speed benefits of walking with the exercise benefits of driving, and for just the cost of a used Honda! Note, of co...
BeginBufferedPaint: It's not just for buffered painting any more
I covered the function in my 2008 PDC presentation, but one thing I didn't mention is that the buffered paint functions are very handy even if you have no intention of painting. Since the buffered paint functions maintain a cache (provided that you remembed to call ), you can use to get a temporary bitmap even if you have no intention of actually painting to the screen. You might want a bitmap to do some off-screen composition, or for some other temporary purpose, in which case you can ask to give you a bitmap, use the bitmap for whatever you like, and then pass when you call to say "Ha ha, just kidding....
Why is my program terminating with exit code 3?
Looks like that's what the Microsoft C runtime uses for an abort.
Watching the battle between Facebook and Facebook spammers
I am watching the continuing battle between Facebook and Facebook spammers with detached amusement. When I see a spam link posted to a friend's Facebook wall, I like to go and figure out how they got fooled. Internet Explorer's InPrivate Browsing comes in handy here, because I can switch to InPrivate mode before visiting the site, so that the site can't actually cause any harm to my Facebook account since I'm not logged in and it doesn't know how to log me in. The early versions were simply Web pages that hosted an embedded YouTube video, but they placed an invisible "Like" button over the playback controls, so ...
How long do taskbar notification balloons appear on the screen?
We saw some time ago that taskbar notification balloons don't penalize you for being away from the computer. But how long does the balloon stay up when the user is there? Originally, the balloon appeared for whatever amount of time the application specified in the member of the structure, subject to a system-imposed minimum of 10 seconds and maximum of 60 seconds. In Windows XP, some animation was added to the balloon, adding 2 seconds of fade-in and fade-out animation to the display time. Starting in Windows Vista, applications are no longer allowed to specify how long they wanted the balloon to appear...
Why does Explorer show a thumbnail for my image that's different from the image?
A customer (via a customer liaison) reported that Explorer somestimes showed a thumbnail for an image file that didn't exactly match the image itself. I have an image that consists of a collage of other images. When I switch Explorer to Extra Large Icons mode, the thumbnail is a miniature representation of the image file. But in Large Icons and Medium Icons mode, the thumbnail image shows only one of the images in the collage. I've tried deleting the thumbnail cache, but that didn't help; Explorer still shows the wrong thumbnails for the smaller icon modes. What is wrong? The customer provided screenshots dem...
Multithreaded UI code may be just as hard as multithreaded non-UI code, but the consequences are different
Commenter Tim Smith claims that the problems with multithreaded UI code are not significantly more than plain multithreaded code. While that may be true on a theoretical level, the situations are quite different in practice. Regardless of whether your multithreaded code does UI or not, you have to deal with race conditions, synchronization, cache coherency, priority inversion, all that mulitthreaded stuff. The difference is that multithreaded problems with non-UI code are often rare, relying on race conditions and other timing issues. As a result, you can often get away with a multithreaded bug, because it may...
If undecorated names are given in the DLL export table, why does link /dump /exports show me decorated names?
If you run the command on a DLL which exports only undecorated names, you may find that in addition to showing those undecorated names, it also shows the fully-decorated names. We're building a DLL and for some functions, we have chosen to suppress the names from the export table by using the NONAME keyword. When we dump the exports, we still see the names. And the functions which we did want to export by name are showing up with their decorated names even though we list them in the DEF file with undecorated names. Where is the decorated name coming from? Is it being stored in the DLL after all? The orig...
Looking at the world through kernel-colored glasses
During a discussion of the proper way of cancelling I/O, the question was raised as to whether it was safe to free the I/O buffer, close the event handle, and free the structure immediately after the call to . The response from the kernel developer was telling. That's fine. We write back to the buffer under a try/except, so if the memory is freed, we'll just ignore it. And we take a reference to the handle, so closing it does no harm. These may be the right answers from a kernel-mode point of view (where the focus is on ensuring that consistency in kernel mode is not compromised), but they are horrible answe...