We saw last time
that you can specify a separator in a menu item template
by specifying zero for everything,
even though technically you're supposed to pass
MFT_SEPARATOR for the flags.
What's the deal with that alternate
form for menu item template separators?
This goes back to the early days of the
InsertMenu function
(and its friends like
Ap...
In a Lisbon grocery store, I was looking at the ingredient panel of a box of cereal. It contained the information in multiple languages, and French came first. I was momentarily stunned by the following warning: Traces possibles d'arachides. I guess this falls in the category of "Raymond misreads French cereal box warnings."
Menus aren't as complicated as dialogs.
There are no fonts, no positioning,
it's just a list of menu items and flags.
Well, okay, there's the recursive part,
when a menu has a submenu.
But that's really the only wrinkle.
Most of it is pretty boring.
The 16-bit classic menu template begins with the following header:
struct MENUHEADER16 {
WORD ...
As with dialog templates, menu templates have also gone through a four-stage evolutionary process. People don't often generate menu templates in code, although the function is there waiting for you once you get the urge. As a result, there aren't many questions from people trying to generate menu templates dynamically, but I'm going to go into t...
If you look at the LOADPARMS32 structure,
you'll find a horrific mishmash.
Double-null-terminated strings,
a null-terminated string,
some WORDs, and
even a Pascal-style string.
What's going on here?
Each of those members comes from a different era in time.
The oldest member is the Pascal-style command line,
which dates back to CP/M.
On CP/M, co...
Firefighters hate the Fourth of July, the holiday dedicated to blowing up stuff, because when amateurs try to blow up stuff, they often blow up stuff they didn't intend to blow up. One of my friends has a particular unfortunate knack of drawing disasters to his neighborhood. One July 4th, a house in his neighborhood burnt down due to a stray fire...
In late 2004, I was working in my office, minding my own business. I normally keep my door open, as do most other people.
«Knock-knock»
I turn around. There's somebody at the door.
"Oh, nothing," the person said. "I just wanted to look at you."
I closed the door and drew my blinds.
What would you have done?
(In retrospe...
Last time, we learned about the dangers of uninitialized floating point variables but left with a puzzle: Why wasn't this caught during internal testing?
I dropped a hint when I described how s work: You have to ask the processor to raise an exception when it encounters a signaling NaN, and the program disabled that exception. Why was an excepti...