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

Newark Liberty International Airport Terminal A travel tips

The line for going through the security checkpoint at Terminal A of Newark Liberty International Airport splits into three lines after you get through the ID check. When you get to the decision point, they all look the same, but don't be fooled. ID / 3 ----------------------------------X >>>-----------|-- 2 ------------------------X check \ 1 -------------X Take line 1. As you can see, it is a much shorter wait than the others. If you observe carefully as you get into line, you'll see that all the people in business suits are in line 1. That's becaus...

Thread affinity of user interface objects, part 3: Menus, icons, cursors, and accelerator tables

The remaining user interface objects in common use are menus, icons, cursors, and accelerator tables. Menus do not have thread affinity. Any thread can use a menu. However, if two threads use a menu, it is the responsibility of those threads to coordinate among themselves how that menu will be used, so that one thread doesn't modify a menu while another is busy displaying it, for example. (More on this subject later.) Icons, cursors, and accelerator tables behave like menus. They do not have thread affinity. They are easier to manage than menus since they cannot be modified once created, so the only thing yo...

New blog on integrating Groove with Office

Andrew Wharton from Groove has started writing about integrating the team and its product with Office. His opening salvo sets the stage and hooked me in for what looks to be an interesting glimpse into life in another division at Microsoft. (Something that is as mysterious to me as it is to you.) In the early days of the Windows division, there was friction among the groups that were thrown together to form the project, because when your group is told to join forces with another group, your natural tendency is to treat the other group as "them". And of course "they" are dumber, slower, and less physically att...

Thread affinity of user interface objects, part 2: Device contexts

Last time, we discussed briefly the thread affinity rules that govern window handles. Device contexts (DCs) also have a certain degree of thread affinity. The thread that calls functions such as must also be the one that calls , but as with window handles, during the lifetime of the DC, any thread can use it. If you choose to use a DC in a multi-threaded manner, it's your responsibility to coordinate the consumers of that device context so that only one thread uses it at a time. For example, to host windowless controls across multiple threads, the host obtains a DC on the host thread, then asks each control ...

Thread affinity of user interface objects, part 1: Window handles

Different objects have different thread affinity rules, but the underlying principles come from 16-bit Windows. The most important user interface element is of course the window. Window objects have thread affinity. The thread that creates a window is the one with which the window has an inseparable relationship. Informally, one says that the thread "owns" the window. Messages are dispatched to a window procedure only on the thread that owns it, and generally speaking, modifications to a window should be made only from the thread that owns it. Although the window manager permits any thread to access such thing...

The difficult balancing act between customization and supportability

My colleague Kam VedBrat (from who I shamelessly stole the pictures of thse high-DPI displays in my PDC talk) discusses the difficult balancing act between customization and supportability. (Part II.) Note that decisions on this subject also also impact compatibility: Windows Vista greatly expands the palette of objects covered by the visual style. Any visual styles designed for Windows XP need to be revised in order to cover those new Windows Vista elements. Whose reponsibility would it be to revise them?

Your profiling tools can manufacture performance issues where there were none

When analyzing the performance of a program, you must be mindful that your performance analysis tools can themselves affect the operation of the system you are analyzing. This is especially true if the performance analysis tool is running on the same computer as the program being studied. People often complain that Explorer takes a page fault every two seconds even when doing nothing. They determine this by opening Task Manager and enabling the Page Faults column, and observing that the number of Page Faults increases by one every two seconds. This got reported so often that I was asked to sit down and figur...

On the dangers of sharing your apartment

My colleague Marc Miller wrote up a brief essay on the subject of dealing with a neutral apartment that has been injected into your single-threaded apartment: COMmunism: Sharing your Apartment. Highly recommended.

Jensen Harris joins the 7am club

My colleague Jensen Harris from the Office User Interface team has joined the 7am club, posting fascinating glimpes into Office history and the upcoming version of Office code-named "Office 12". And they come out at 7am every weekday. Then again, maybe he's not real either. Maybe he's some kind of a robot.