The much-misunderstood “nop” action

Last month, the printers were reconfigured in our building and we got an announcement that went like this: Subject: Printer/Copier Reconfiguration Microsoft Digital Campus Program Action Required blah blah blah printers are being reconfigured blah blah blah Action(s) to be taken: No action is required as the print path information will remain the same. Sometimes…

6

Murphy’s law for school

If you know the answer to every question but one, the teacher will call on you to answer that one. I’m learning this rule all over again.

2

Why don’t notification icons get a message when the user clicks the “X” button?

If such a notification were generated, ill-behaved programs would just react to a click on the balloon’s “X” button with an annoying follow-up dialog like, “Are you sure you want to ignore my wonderful message?” So there was a conscious decision not to give them the chance. In the Before Time, software was trusted not…

9

Answer to previous exercise

If the program starts with the mouse already in the client area without moving, why do you get a beep? Because of the spurious WM_MOUSEMOVE message that is generated when a window is created. In this case, the spurious message is a good thing, since it lets us do our mouse work at window creation.


Why is there no WM_MOUSEENTER message?

There is a WM_MOUSELEAVE message. Why isn’t there a WM_MOUSEENTER message? Because you can easily figure that out for yourself. When you receive a WM_MOUSELEAVE message, set a flag that says, “The mouse is outside the window.” When you receive a WM_MOUSEMOVE message and the flag is set, then the mouse has entered the window….

6

Why doesn’t the clock in the taskbar display seconds?

Early beta versions of the taskbar clock did display seconds, and it even blinked the colon like some clocks do. But we had to remove it. Why? Because that blinking colon and the constantly-updating time were killing our benchmark numbers. On machines with only 4MB of memory (which was the minimum memory requirement for Windows…

27

Other uses for bitmap brushes

Bitmap brushes used to be these little 8×8 monochrome patterns that you could use for hatching and maybe little houndstooth patterns if you were really crazy. But you can do better. CreatePatternBrush lets you pass in any old bitmap – even a huge one, and it will create a brush from it. The bitmap will…

13

Why is address space allocation granularity 64K?

You may have wondered why VirtualAlloc allocates memory at 64K boundaries even though page granularity is 4K. You have the Alpha AXP processor to thank for that. On the Alpha AXP, there is no “load 32-bit integer” instruction. To load a 32-bit integer, you actually load two 16-bit integers and combine them. So if allocation…

8

In Explorer, you can right-click the icon in the caption

In Explorer, you can right-click the icon in the caption to get the context menu for the folder you are viewing. (Very handy for “Search” or “Command Prompt Here”.) Apparently not enough people realize this. In Windows 95, we tried to make it so most icons on the screen did something interesting when you right-clicked…

15