The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

I speak German better in my dream than I do in real life
Feb 18, 2013
Post comments count 0
Post likes count 0

I speak German better in my dream than I do in real life

Raymond Chen
Raymond Chen

I dreamed that I was at a large trade show, where everybody had cleared the center of the main floor to make room for an impressive real-time holography demo. After the demo was over, everybody moved their chairs back, but the German delegation had difficulty returning their chairs to the exact position they took them from, because everybody else (not being German) just put the chairs in rows without regard for their original row and seat number. Next came dinner, and I had to help interpret for a German attendee (who in retrospect may have been Angela Merkel with dark hair) who had taken two appetizers and ...

Display control buttons on your taskbar preview window
Feb 18, 2013
Post comments count 0
Post likes count 0

Display control buttons on your taskbar preview window

Raymond Chen
Raymond Chen

A tiny control surface.

Debug session: Why is an LPC server not responding?
Feb 15, 2013
Post comments count 0
Post likes count 0

Debug session: Why is an LPC server not responding?

Raymond Chen
Raymond Chen

A particular scenario was hanging, and the team responsible for the scenario debugged it to the point where they saw that their X component was waiting for their Y component, which was waiting for Explorer, so they asked for help chasing the hang into Explorer. The team was kind enough to have shared what they've learned so far: kd> !alpc /m 9c14d020 Message 9c14d020 MessageID : 0x0274 (628) CallbackID : 0xCCA5 (52389) SequenceNumber : 0x00000016 (22) Type : LPC_REQUEST DataLength : 0x0094 (148) TotalLength : 0x00AC...

If you can’t find the function, find the caller and see what the caller jumps to
Feb 14, 2013
Post comments count 0
Post likes count 0

If you can’t find the function, find the caller and see what the caller jumps to

Raymond Chen
Raymond Chen

You're debugging a program and you want to set a breakpoint on some function, say, netapi32!Ds­Address­To­Site­NameW, but when you execute the bp netapi32!Ds­Address­To­Site­NameW command in the debugger, the debugger says that there is no such function. The Advanced Windows Debugging book says that the bp command should set a breakpoint on the function, but the debugger says that the symbol cannot be found. I used the x netapi32!* command to see that the debugger did find a whole bunch of symbols, and it says that the symbols were loaded (from the public symbol store), but ne...

How do I launch a file as if it were a text file, even though its extension is not .txt?
Feb 13, 2013
Post comments count 0
Post likes count 0

How do I launch a file as if it were a text file, even though its extension is not .txt?

Raymond Chen
Raymond Chen

You might have a program that generates log files or other text content with an extension other than . You naturally might want to open these documents in the user's default text editor. You might decide to ask the Windows developer support team, "How can I figure out what program is the handler for text files?" The idea being that once you get this program name, you can then run it yourself, with the document on the command line. And you would also be running into the trap of looking for the answer to a question rather than a solution to a problem. For one thing, the default handler for the file type might ...

What’s the story of the onestop.mid file in the Media directory?
Feb 12, 2013
Post comments count 0
Post likes count 0

What’s the story of the onestop.mid file in the Media directory?

Raymond Chen
Raymond Chen

If you look in your folder, you'll find a MIDI file called . What's the story behind this odd little MIDI file? Aaron Margosis considers this file a security risk because "if an attacker can cause that file to be played, it will cause lasting mental pain and anguish to everybody within earshot." Despite Wikipedia's claims[citation needed], the file is not an Easter Egg. The file was added in in Windows XP with the comment "Add cool MIDI files to replace bad old ones." So as bad as is, the old ones must have been even worse! Okay, but why were they added? For product support. The product support...

Let me take this shortcut across Lake Saskatchewan
Feb 11, 2013
Post comments count 0
Post likes count 0

Let me take this shortcut across Lake Saskatchewan

Raymond Chen
Raymond Chen

I dreamed that I had to drive from Los Angeles to Berkeley to catch my flight home. To do this, I used a product from a local startup company: A computerized map of the Bay Area. There were two routes across Lake Saskatchewan. The southern route is highway I-70, and the northern route is an elevated highway that goes right past the head of the Canadian Statue of Freedom, a 300-foot-tall statue carved from a single rock. This shows that computer nerds are horrible cartographers: Berkeley has an airport, Los Angeles is on the peninsula just south of San Francisco, and the Bay Area is in Canada. Sure, this is ...

Display an overlay on the taskbar button
Feb 11, 2013
Post comments count 0
Post likes count 0

Display an overlay on the taskbar button

Raymond Chen
Raymond Chen

Today's "Little Program" displays an overlay on the taskbar button. I've seen some people call this a "badge", but "overlay" is the official term. Start with our scratch program and make the following changes: #include <comip.h> #include <comdef.h> #include <shlobj.h> #include <shellapi.h> _COM_SMARTPTR_TYPEDEF(ITaskbarList3, __uuidof(ITaskbarList3)); I decided to shake things up and use a different smart pointer library: com_ptr_t. (That'll teach you to complain that I don't use a smart pointer library in my samples. Now you get to complain that I use the wrong smart pointer libr...

The Essential Guide To Dim Sum
Feb 8, 2013
Post comments count 0
Post likes count 0

The Essential Guide To Dim Sum

Raymond Chen
Raymond Chen

The folks over at BuzzFeed Food have put together this marvelous Essential Guide To Dim Sum. The field guide includes pictures of dim sum offerings, organized by food preparation style, then sub-categorized by physical appearance. Each dish is accompanied by its name in three languages (English, Mandarin Chinese, and Cantonese), along with symbolic information similar to a clothing care tag that encodes information like recommended method of eating. Save some radish cakes for me. Via Tony Chor.