The Old New Thing

An auto-reset event is just a stupid semaphore

When you create an event with the CreateEvent 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 ...
Comments are closed.0 0
Code

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

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

Psychic debugging: Understanding DDE initiation

You too can use your psychic powers to debug the following problem: We have a problem with opening documents with our application by double-clicking them in Explorer. What's really strange is that if we connect a debugger to Explorer and set a breakpoint on kernel32!CreateProcessW, then wait a moment after CreateProcess returns, then hit '...
Comments are closed.0 0
Code

Three-Minute Masterpieces (2006)

The Seattle Times invited its readers to make three-minute movies, and the best were screened at the Seattle International Film Festival. Or you can watch them online...

A single-instance program is its own denial of service

There are many ways a program can establish itself as a single-instance program; I won't go into them here. But once people head down the path of a single-instance program, they bump into another issue in their security review: Denial of service. We are using a named mutex with a fixed name in order to detect whether another copy of the ...

Announcements on the ferry, one self-explanatory, one not

While I was riding the ferry last Saturday, there were two announcements made over the public address system. "All crew please report to the Second Mate's office." What were they all doing in the Second Mate's office? Would the whole crew fit into the office? And while all the crew are in the Second Mate's office, who's steering the ferry? ...

Why can't you programmatically reorder the items on the Start menu?

The classic Start menu and the "All Programs" portion of the Windows XP Start menu permit you to customize the order of the shortcuts that appear there. You can use drag/drop to rearrange them, or force them to be sorted by name. But why is there no programmatic interface to these actions? Because the power would be used for evil far ...

Understanding what significant digits really mean

A double-precision floating point number carries fifteen significant digits. What does this really mean? I multiplied 0.619207 by 10,000,000 and got 6192069.999999991 instead of 6192070. That's only six significant digits; where's my fifteen? Talking about significant digits is really just a shorthand for talking about relative precision. "...

Window class properties apply to all windows that belong to the class

Window class properties apply to all windows that belong to the class. That's why they're called class properties. This seems like an obvious thing to say when put in so many words, but I see many "solutions" that lose sight of this simple fact. All the properties that you set in the WNDCLASS (or WNDCLASSEX) are window class properties, as ...
Comments are closed.0 0
Code