The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Multiplexing multiple tools into one in a tooltip
Jun 28, 2006
Post comments count 0
Post likes count 0

Multiplexing multiple tools into one in a tooltip

Raymond Chen
Raymond Chen

The tooltip control lets you set multiple "tools" (regions of the owner window) for it to monitor. This is very convenient when the number of tools is manageably small and they don't move around much. For example, the toolbar control creates a tool for each button. But if you have hundreds or thousands of screen elements with tooltips, creating a tool for each one can be quite a lot of work, especially if the items move around a lot. For example, the listview control does not create a separate tool for each listview item, since a listview can have thousands of items, and scrolling the view results in the items m...

… so it doesn't poop all over your office
Jun 27, 2006
Post comments count 0
Post likes count 0

… so it doesn't poop all over your office

Raymond Chen
Raymond Chen

The other day I caught a fragment of a conversation, namely somebody concluding a sentence with the clause "... so it doesn't poop all over your office". I don't know what they were talking about and I'm not sure I want to find out. (Ry Jones thinks I was the victim a game of tomato funeral. I'm not convinced; it was a conversation that I had been drifting in and out of at the lunch table. I just picked a bad time to drift back in.)

Using custom-draw in tooltips to adjust the font
Jun 27, 2006
Post comments count 0
Post likes count 0

Using custom-draw in tooltips to adjust the font

Raymond Chen
Raymond Chen

Last time, we looked at in-place tooltips. In that example, we finessed the font problem by simply setting the destination font into the tooltip control. We got away with that since we had only one tool. But if you have multiple tools with different fonts, then you can't set a font into the tooltip control and expect it to work for every tool. That's where custom draw comes in. Start with the program from last time, but this time, we'll set the font via custom-draw instead of setting it globally. Of course, doing this is overkill in our case where we have only one tool, so you'll have to imagine that the t...

Look who bought my name
Jun 26, 2006
Post comments count 0
Post likes count 0

Look who bought my name

Raymond Chen
Raymond Chen

Commenter Pavel Vozenilek noticed that if you type my name into Google, there is only one sponsored link, and it's from Google themselves, inviting you to apply for a job there. (Maybe I should sue. Perhaps I can get a settlement.) When I mentioned this to some other people at Microsoft, they started hunting around to see what sort of ads came up on Google when they searched for other names. Eric Gunnerson and Brad Abrams are available at low prices, and you can get Randy Holloway on eBay. Of all the Microsoft bloggers, the only other one that gets the Google Jobs treatment is Larry Osterman. (Note: Al...

Coding in-place tooltips
Jun 26, 2006
Post comments count 0
Post likes count 0

Coding in-place tooltips

Raymond Chen
Raymond Chen

Today we'll look at how to implement in-place tooltips. These are tooltips that appear when the user hovers the mouse over a string that cannot be displayed in its entirety. The tooltip overlays the partially-displayed text and provides the remainder of the text that had been truncated. The keys to this technique are the notification (which lets you adjust the positioning of a tooltip before it is shown) and the message which tells you precisely where you need the tooltip to be. Start with our scratch program and add the following: After declaring a few variables, we dig into our computations at window c...

The subtle usability considerations of conference nametags
Jun 23, 2006
Post comments count 0
Post likes count 0

The subtle usability considerations of conference nametags

Raymond Chen
Raymond Chen

When you go to a conference or some other event where everybody wears a nametag, pay closer attention to the nametag design. There are many subtle usability mistakes that I see far too often. First of all, is your name easy to read? It's called a nametag, after all; the name and affiliation of the wearer should be the most prominent thing on the tag. I've been to events where the most prominent thing on the nametag was the name of the conference itself. Hey, everybody presumably already knows what conference they're attending. It's printed on the agenda sheet, it's printed on the tote bag, it's printed on eve...

The continuing phenomenon of size inflation in fast food
Jun 22, 2006
Post comments count 0
Post likes count 0

The continuing phenomenon of size inflation in fast food

Raymond Chen
Raymond Chen

Wendy's is getting rid of "Biggie" and "Great Biggie" size drinks and fries from their menu. Oh, they're still offering them, just with a different name. What used to be "Biggie" is now "medium" and what used to be "Great Biggie" is now "large". Even the "small" drink is a massive 20 ounces, or two and a half FDA servings.

An auto-reset event is just a stupid semaphore
Jun 22, 2006
Post comments count 0
Post likes count 0

An auto-reset event is just a stupid semaphore

Raymond Chen
Raymond Chen

When you create an event with the function, you get to specify whether you want an auto-reset event or a manual-reset event. Manual-reset events are easy to understand: If the event is clear, then a wait on the event is not satisfied. If the event is set, then a wait on the event succeeds. Doesn't matter how many people are waiting for the event; they all behave the same way, and the state of the event is unaffected by how many people are waiting for it. Auto-reset events are more confusing. Probably the easiest way to think about them is as if they were semaphores with a maximum token count of one. If the eve...

It's still not a democracy, but at least other people have noticed, too
Jun 21, 2006
Post comments count 0
Post likes count 0

It's still not a democracy, but at least other people have noticed, too

Raymond Chen
Raymond Chen

I'm glad I'm not the only person to notice that elections for boards of directors are completely rigged so that the nominees always win and there's nothing you can do about it. It appears that the issue was the hot topic in this year's proxy war skirmishes. This year, one company actually called me at home asking me to send in my proxy. I guess they didn't have enough votes for the meeting to be held. I explained that not voting was an intentional decision on my part, since it was the only way I could prevent the board of directors from being elected. The caller appeared mollified by that explanation and didn...