Showing results for February 2005 - Page 2 of 3 - The Old New Thing

Feb 15, 2005
0
0

You cannot globally reserve user-mode address space

Raymond Chen
Raymond Chen

Occasionally, somebody asks for a way to reserve user-mode address space globally. In other words, they want to allocate address space in all processes in the system (current and future). Typically this is because they want to map some memory into each process and don't want to go through the trouble of designing the shared memory blocks so that t...

Code
Feb 14, 2005
0
0

How to act like you know Chinese even though you don't

Raymond Chen
Raymond Chen

I was riding in a car with a friend when a Chinese pop album spun up on the CD. I made a remark about the song, and my friend, knowing that I was studying Mandarin, asked me, "Do you know what she's singing about?" I immediately replied, "She's singing about love." "Wow," my friend responded. "Your Chinese is quite good." "Nope," I said. "But a...

Non-ComputerExcursions into East Asian pop music
Feb 14, 2005
0
0

LoadLibraryEx(DONT_RESOLVE_DLL_REFERENCES) is fundamentally flawed

Raymond Chen
Raymond Chen

There is a flag to the function called . The documentation says, If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization and termination. Also, the system does not load additional executable modules that are referenced by the specified module. If you are planning onl...

Code
Feb 11, 2005
0
1

Windowless controls are not magic

Raymond Chen
Raymond Chen

It seems that when people notice that the Internet Explorer rendering engine doesn't use HWNDs for screen elements, they think that Internet Explorer is somehow "cheating" and doing something "undocumented" and has an "unfair advantage". Nevermind that windowless controls have been around since 1996. They aren't magic. Mind you, they're a lot of ...

Other
Feb 10, 2005
0
0

Why do minimized windows have an apparent size of 160×31?

Raymond Chen
Raymond Chen

We discussed a few months ago the issue of where windows minimized to before the taskbar was invented. In the modern taskbar world, why do minimized windows have an apparent size of 160x31? The size isn't just apparent. That's really their size. You can see them, for example, if you fire up a program that uses the Multiple Document Interface. ...

History
Feb 9, 2005
0
0

The dangers of filtering window messages

Raymond Chen
Raymond Chen

The and functions allow you to pass a filter, restricting the window handle or range of messages that the function will retrieve from the message queue. While it's okay to use these filters, make sure you eventually get around to making an unfiltered call so that any straggling messages can come through. A common mistake is to use a window-fil...

Code
Feb 8, 2005
0
0

What other effects does DS_SHELLFONT have on property sheet pages?

Raymond Chen
Raymond Chen

Once you invent a new flag you can start using it to fix errors of the past without breaking backwards compatibility. One of the errors of the past was that property sheet page dimensions were taken relative to the "MS Sans Serif" font, even if the page used some other font. This sample dialog template says that it is 212dlu wide and 188dlu t...

CodeHistory
Feb 7, 2005
0
0

Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?

Raymond Chen
Raymond Chen

You may have noticed that the numerical value of the flag is equal to . Surely that isn't a coincidence. The value of the flag was chosen so that older operating systems (Windows 95, 98, NT 4) would accept the flag while nevertheless ignoring it. This allowed people to write a single program that got the "Windows 2000" look w...

History
Feb 4, 2005
0
0

What's the deal with the DS_SHELLFONT flag?

Raymond Chen
Raymond Chen

It indicates that you want the Windows 2000 default shell font. But that doesn't mean that you're going to get it. In order to indicate that you would like the "Windows 2000" look for your dialog, you have to do three things and hope for a fourth: If all four conditions are satisfied, then your dialog gets the "Windows 2000" loo...

Code
Feb 3, 2005
0
0

Why is breadth-first searching better for file system tree walking?

Raymond Chen
Raymond Chen

Earlier, Eric Lippert discussed one scenario where breadth-first searching is better than depth-first searching. Today, I'll tell you about another. If you go back to the old MS-DOS file enumeration functions, you'll find that there is a "Find first file" function and a "Find next file" function, but no "Find close" function. That's because the ...

History