The Old New Thing

The importance of remembering parity in a back-and-forth race on your flying bicycle

I dreamed that one of my friends had made the U.S. cycling team. (Perhaps because everybody else got busted for doping.) Even more implausibly, I also made the team. To celebrate, he challenged me to a short race. The path ran along a river, in which a medium-sized boat was setting sail. Our bicycles somehow could fly (which we considered ...

Copying a file to the clipboard so you can paste it into Explorer or an email message or whatever

Today's Little Program takes a fully-qualified file name from the command line and puts that file onto the clipboard. Once there, you can paste it into an Explorer window, or into an email message, or a word processing document, or anybody else who understands shell data objects. #include <windows.h> #include <shlobj.h> #include...
Comments are closed.0 0
Code

Who sends the initial WM_UPDATEUISTATE message?

Last time, we looked at the confusingly-named WM_UPDATE­UI­STATE and WM_CHANGE­UI­STATE messages. But how does the whole indicator thingie get off the ground? The default state for a window is to show all indicators. But as a special trick, the dialog manager will send a WM_UPDATE­UI­STATE message with ...
Comments are closed.0 0
Code

Your electric fan is trying to kill you, and other cultural superstitions

In Korea, it is generally believed that leaving a fan on in an enclosed room can be fatal. Ken Jennings looks at cultural superstitions and wrote a Slate article focusing on the scourge of Korean fan death. My mother told me that handling cellophane tape makes you sterile. Though that may have just been her way of getting me to stop ...

Untangling the confusingly-named WM_UPDATEUISTATE and WM_CHANGEUISTATE messages

I always get confused by the WM_UPDATE­UI­STATE and WM_CHANGE­UI­STATE messages, and I have to go figure them out each time I need to mess with them. So this time, I'm going to write it down so I don't forget. Because the act of writing it down helps me to remember. It's like in school, where the teacher says, "This is a ...
Comments are closed.0 0
Code

What does GDI use biXPelsPerMeter and SetBitmapDimensionEx for?

What does GDI use BITMAP­INFO­HEADER.biXPels­Per­Meter and Set­Bitmap­Dimension­Ex for? Nothing. The BITMAP­INFO­HEADER.biXPels­Per­Meter and BITMAP­INFO­HEADER.biYPels­Per­Meter are completely ignored by GDI when loading a bitmap. The values are there for the benefit of image-...
Comments are closed.0 0
Code

Microspeak: booked

Remember, the term Microspeak is not tightly scoped to mean jargon used only at Microsoft. It's jargon used at Microsoft more often than in general usage. Today, it's a term that you really need to master if you want to talk with others about project planning. To book a feature is to commit to implementing the feature, including assigning ...

The secret lair of Administrative Assistants

I dreamed that a colleague and I were looking for a copy of a TN3270 emulator in order to investigate a bug. The search took us into an abandoned-looking Building 5. But upon entering, we discovered that Building 5 was actually the secret lair of all the Administrative Assistants. Oh, and we eventually found the bug in TN3270. It ...

How can I display a live screenshot of a piece of another application?

Today's Little Program takes a rectangular portion of another application and continuously replicates it in its own client area. You might want to do this if you want to monitor a portion of an application like a custom progress bar, and the application doesn't use the Windows 7 taskbar progress indicator feature. (Maybe it's an old ...
Comments are closed.0 0
Code

Feedback usabilla icon