The Old New Thing

Microspeak: The bug farm

In its most general sense, the term bug farm refers to something that is a rich source of bugs. It is typically applied to code which is nearly unmaintainable. Code can arrive in this state through a variety of means. Poor initial design. An initial design that has been pushed far beyond its original specification (resulting in ...

The clipboard viewer linked list is no longer the responsibility of applications to maintain, unless they want to

Commenter Nice Clipboard Manager (with drop->clipboard) wonders why Windows still uses a linked list to inform programs about clipboard modifications. If any clipboard viewer fails to maintain the chain, then some windows won't get informed of the change, and if a clipboard viewer creates a loop in the chain, an infinite loop results. ...
Comments are closed.0 0
Code

Why can't I PostMessage the WM_COPYDATA message, but I can SendMessageTimeout it with a tiny timeout?

After receiving the explanation of what happens to a sent message when Send­Message­Timeout reaches its timeout, a customer found that the explanation raised another question: If the window manager waits until the receiving thread finishes processing the message, then why can't you post a WM_COPY­DATA message? "After all, Send­...
Comments are closed.0 0
Code

Some preliminary notes from //build/ 2011

Hey everybody, I'm down at the //build/ conference. (The extra slash is to keep the d from falling over.) I'm not speaking this year, but you can find me in the Apps area of the Expo room today until 3:30pm (except lunchtime), and Friday morning before lunch. I'll also be at Ask the Experts tonight. There are so many great sessions to choose ...

What happens to a sent message when SendMessageTimeout reaches its timeout?

The Send­Message­Timeout function tries to send a message, but gives up if the timeout elapses. What exactly happens when the timeout elapses? It depends. The first case is if the receiving thread never received the message at all. (I.e., if during the period the sender is waiting, the receiving thread never called GetMessage, ...
Comments are closed.0 0
Code

A common control for associating extensions is well overdue

Mark complained that a common control for associating extensions is well overdue. This is a recurring theme I see in the comments: People complaining that Windows lacks some critical feature that it in fact already has. (In the case, Windows had the feature for over two years at the time the question was asked. Maybe the SDK needs a ribbon? ...
Comments are closed.0 0
Code

Why are the building numbers on Microsoft main campus so erratic?

Carrie complains that the building numbers on Microsoft main campus are completely random. Why is building 22 near buildings 40 and 41, far, far away from building 24? Because the Microsoft campus evolved. Many many years ago, the space on which the central Microsoft campus resides was a mill. Eventually it became an office park, and when ...

Is this a really bug with CreateWindowEx or am I just confused?

Somebody sent me email pointing out strange behavior in the MessageBox function if you fail a window creation by returning −1 from the WM_CREATE message. On the other hand, returning FALSE from WM_NCCREATE seems to work just fine. "So why the difference with WM_CREATE?" #include <windows.h> LRESULT CALLBACK WndProc(HWND hWnd, ...
Comments are closed.0 0
Code

Why waste your money on the car when it's the sound system you care about?

There is apparently a subculture of people who decide to economize on the car part of the "loud stereo in car" formula (since they really don't care about the car—it's all about the music) and put their loud stereo on the back of a bicycle instead. This quotation from the article caught my attention: "People say, 'It's the next best ...