The Old New Thing

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 ...
Comments are closed.0Other

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 uTimeout member of the NOTIFYICONDATA structure, subject to a system-imposed...

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 ...

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, ...
Comments are closed.0Code

If undecorated names are given in the DLL export table, why does link /dump /exports show me decorated names?

If you run the link /dump /exports 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 ...
Comments are closed.0Other

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 OVERLAPPED structure immediately after the call to CancelIo. The response from the kernel developer was telling. That's fine. We write back to the buffer under a try/except, ...
Comments are closed.0Code

Why double-null-terminated strings instead of an array of pointers to strings?

I mentioned this in passing in my description of the format of double-null-terminated strings, but I think it deserves calling out. Double-null-terminated strings may be difficult to create and modify, but they are very easy to serialize: You just write out the bytes as a blob. This property is very convenient when you have to copy around ...
Comments are closed.0Code

Why is hybrid sleep off by default on laptops? (and how do I turn it on?)

Hybrid sleep is a type of sleep state that combines sleep and hibernate. When you put the computer into a hybrid sleep state, it writes out all its RAM to the hard drive (just like a hibernate), and then goes into a low power state that keeps RAM refreshed (just like a sleep). The idea is that you can resume the computer quickly from sleep, ...

Sorting is a state and a verb (and a floor wax and a dessert topping)

Cliff Barbier points out that after you sort an Explorer view by name, new items are not inserted in their sorted position. This goes back to the question of whether sorting is a state or a verb. If you take an Explorer folder and say Sort by Name, do you mean "From now on, always show the contents of this folder sorted by name"? Or do you...
Comments are closed.0Other

A function pointer cast is a bug waiting to happen

A customer reported an application compatibility bug in Windows. We have some code that manages a Win32 button control. During button creation, we subclass the window by calling Set­Window­Subclass. On the previous version of Windows, the subclass procedure receives the following messages, in order: WM_WINDOWPOSCHANGING ...
Comments are closed.0Code