The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts

Fiddling with the fonts, part 2: Keeping the English font small

We concluded last time that we wanted the custom large font to apply only to the columns containing Chinese characters and leave the original font in place for the English columns. We do this by carrying two fonts around, choosing the appropriate one for each column. class RootWindow : public Window { ... private: HWND m_hwndLV; HWND m_hwndEdit; HWND m_hwndLastFocus; HFONT m_hfChinese; HFONT m_hfNormal; int m_cyEdit; ... } RootWindow::RootWindow() : m_hfChinese(NULL) , m_hfNormal(NULL) { } RootWindow::~RootWindow() { if (m_hfChinese) DeleteObject(m_hfChinese); if (m_hfNormal) DeleteObject(m_hfNo...

Fiddling with the fonts, part 1: Making the Chinese characters larger

Let's pay a quick visit to our continuing dictionary project. One of the things you may have noticed is that the Chinese characters are unreadably small. Let's fix that by making them larger. class RootWindow : public Window { public: virtual LPCTSTR ClassName() { return TEXT("Scratch"); } static RootWindow *Create(); RootWindow(); ~RootWindow(); ... private: HWND m_hwndLV; HWND m_hwndEdit; HWND m_hwndLastFocus; HFONT m_hfChinese; int m_cyEdit; ... } RootWindow::RootWindow() : m_hfChinese(NULL) { } RootWindow::~RootWindow() { if (m_hfChinese) DeleteObject(m_hfChinese); } LRESULT RootWindow::On...

Typo patrol at the PDC

You can find the following typographical errors in the Big Room at the PDC: If you can locate all three of them and catch me at the PDC (say at the Fundamentals Lounge or at the Ask the Experts table), I'll award you a prize of um (rummaging through my bag) how about a retractable network cable? (Or an autographed business card? But then again, anybody can get one of those just by asking for one.)

Like an invention out of Harry Potter, except that Harry’s would use a quill

When I heard this story from Swedish Radio, it struck me as the sort of object that would exist in the imaginary world of Harry Potter. Raymond's bad translation follows: Pen can help dyslexics With today's cheaper and cheaper microelectronics, it becomes possible for young inventors to produce new products without a lot of resources. A new idea for a smart-pen for speech synthesis and voice recognition is an example of this. The pen intended primarily for dyslexics has been produced by Johan Strömbom, a student at the Chalmers University of Technology. It is a pen which produces speech from writing...

The double-Ctrl+Alt+Del feature is really a kludge

Most people who care about such things know that you can press Ctrl+Alt+Del twice from the Welcome screen and sometimes you will get a classic logon dialog. (Note: "Sometimes". It works only if the last operation was a restart or log-off, for complicated reasons that are irrelevant to this discussion.) The ability to do the double-Ctrl+Alt+Del was added as a fallback just in case there turned out to be some important logon scenario that the new Welcome screen failed to cover, but which the designers had failed to take into account by simple oversight. Scenarios such as smartcard or fingerprint logon. In othe...

Sorry I missed you all this morning

Sorry to all you PDCers who stopped by the Fundamentals Lounge to see me. The scheduling software that the PDC organizers cooked up is, um, "suboptimal" and listed me for Tuesday 11.30a–2.30p instead of 2.30p–5.30p. During the early afternoon shift, I was actually in the Hands-On Lab. But I'll be in the Lounge on Thursday after my talk all afternoon, really. I will try to be in the Lounge on Wednesday, but I may have to take refuge in the Speaker Prep Room to deal with a major last-minute change to my talk. Whoa a huge stream of people just flooded in. I'll catch up with you folks later.

Why is there no all-encompassing superset version of Windows?

Sometimes, I am asked why there is no single version of Windows that contains everything. Instead, as you move up the ladder, say, from Windows XP Professional to Windows Server 2003, you gain server features and lose workstation features. Why lose features when you add others? Because it turns out no actual customer wants to keep the workstation features on their servers. Only developers want to have this "all-encompassing" version of Windows, and making it available to them would result in developers testing their programs on a version of Windows no actual customer owns. I think one of my colleag...

Annoying renditions of the songs of Elvis

Jim Nayder of The Annoying Music Show pops by NPR studios every so often—hey, guys, if you changed the locks, this might stop him—whereupon he tortures the general public with musical offenses that should be outlawed by the Geneva Conventions. Most recently, he offered a series of reinterpretations of the works of Elvis Presley. What's really scary is that the songs presented in the segment are among the less awful offerings. For genuine musical pain, check out Love Me Tender [WMV] [Real] as performed by "Sweden's Singin' Sensation" Eilert Pilarm. (Quick tip: "Lyssna" is Swedish for "listen.") ...

Richard E. Grant as Dr. Who

While waiting for the Ninth and Tenth Doctors to reach the States, I was tipped off to some animated Dr. Who episodes on the BBC web site. These are really well done and managed to slake my Doctor cravings for a little while longer. In particular, Richard E. Grant's second turn as the somewhat Earth-obsessed Time Lord in Scream of the Shalka is a must-see. The tired frustration of his Doctor is a refreshing change from the more amiable personas he's had in recent incarnations. After saving the Earth (nay, the universe) from certain destruction for over forty years, you kind of can't blame him for ...