The Old New Thing

A day in the trenches

I got up at 5 this morning to spend the day at Product Support Services answering phones: today was the day the Blaster worm launched its second wave. And by a startling coincidence, the person at the station next to me was Michael Howard our Senior Security Program Manager and author of Writing...

Answer to exercise

The WM_SIZING handler intercepts only interactive resizing. If the user right-clicks the taskbar and selects "Cascade Windows", this resizes the window directly without going through the interactive WM_SIZING step...

Scrollbars part 8 – Integral interactive resizing

Enforcing integrality solves the fractional-line problem, but notice that when you grab the top or bottom edge and resize the window, the resize feedback doesn't match the actual window you get back if you drag the window to a non-integral size. (You may need to turn off full window drag to see this effect...

Why can't I remove "for test/evaluation purposes only"?

"Why can't I remove 'for test/evaluation purposes only'? I know I'm running an evaluation edition, I don't need it rubbed in my face." This prevents unscrupulous OEMs from selling machines with the evaluation edition of the product instead of the retail version. (Yes, this has happened before. ...

Scrollbars part 7 – Integrality

If you play around with resizing the window, you can get a fractional line to appear at the bottom of the screen. This is not normally a problem until you scroll to the very end of the list, say, by pressing the key, at which point an ugly blank space appears at the bottom. This ugly blank space is ...

Answers to exercises

What is the significance of the cast in the computation of ? It isn't. I got the question wrong. The real question should have been "What is the significance of the cast in the computation of ?" The answer is to ensure that the computation is performed with signed integers ...

Why is a registry file called a "hive"?

Useless trivia day. Why is a registry file called a "hive"? Because one of the original developers of Windows NT hated bees.  So the developer who was responsible for the registry snuck in as many bee references as he could.  A registry file is called a "hive", and ...

A subtlety in the keyboard code

I neglected to call it out explicitly in the text for Part 5:  Notice that I use cRepeat to determine how many lines/pages to scroll.  This allows us to scroll the correct amount even if we are falling behind on input processing and are missing some autorepeats...