Showing archive results for 2008

May 12, 2008
Post comments count0
Post likes count1

How do I flash my window caption and taskbar button manually?

Raymond Chen

Commenter Jonathan Scheepers wonders about those programs that flash their taskbar button indefinitely, overriding the default flash count set by . The function and its simpler precursor let a program flash its window caption and taskbar button manually. The window manager flashes the caption automatically (and Explorer follows the caption by...

Code
May 9, 2008
Post comments count0
Post likes count0

Mother's Day is for all mothers, not just your own mother

Raymond Chen

This upcoming Sunday is Mother's Day in the United States, and I'm reminded of a little story from several years ago. One day, we asked a colleague how he and his new child were planning to celebrate Mother's Day. "Yup, I'm all over that. I mailed a gift to my mother earlier this week, and I'll call her on Sunday." — Um, aren't you forgett...

Non-Computer
May 8, 2008
Post comments count0
Post likes count0

The economics of soccer penalty kicks

Raymond Chen

I'm fascinated by economics, specifically the application of economic theories to things you wouldn't normally consider as economics. Back during the World Cup, Slate's undercover economist column took a look at the economics of penalty kicks. Steven D. Levitt, co-author of another paper on the subject, writes in more detail on the unusuall...

Non-Computer
May 8, 2008
Post comments count0
Post likes count1

Gentle reminder: On a dialog box, do not give OK and Cancel accelerators

Raymond Chen

I know most of you know this, but I'm going to say it for the record. When you have a dialog box with an OK and/or Cancel button, do not give the keys accelerators. In other words, simply write The dialog manager already has those buttons covered. The hotkey for the OK button is Enter (since it is the default pushbutton), and the hotkey for the...

Code
May 7, 2008
Post comments count0
Post likes count0

The new dietary restriction landscape

Raymond Chen

Non appetit, the modern quandary of preparing a dinner for people who all have different types of dietary restrictions. Depending on whom I invite to dinner, I may have to put together a meal that conforms to one or more of the following restrictions: low-fat, pescetarian, vegetarian, nondairy, non-pork, non-beef. (Yes, many of these categories o...

Non-Computer
May 7, 2008
Post comments count0
Post likes count1

Apparently I've been promoted by mistake all these years

Raymond Chen

A few years ago, this posting on the secret to getting promoted caught my eye. After several years at Microsoft, I had an epiphany today. I came to the realization that the best way, rather the only way -- to get promoted is to demonstrate the ability to hire and retain top talent. Other factors do go a long way but without the ability to hire, y...

Other
May 6, 2008
Post comments count0
Post likes count1

Psychic debugging: Why does ExitProcess(1) produce an exit code of zero?

Raymond Chen

Here's a question that came from a customer. By now, you should already have the necessary psychic powers to answer it. Our program calls to indicate that it exited unsuccessfully. The process that launched our program waits for the program to exit and then calls to retrieve the exit code. The function succeeds, but the exit code is zero! How c...

Code
May 5, 2008
Post comments count0
Post likes count0

News flash: It's dangerous to drive a car if you are blind

Raymond Chen

The BBC reminds us that if you have no eyes, it's dangerous for you to drive a car. Follow-up: The man was given a suspended jail sentence and—I am not making this up—has been banned from driving for three years. Three years?

Non-ComputerNews flash