The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Some small stories about the giant satellite dish antenna that was behind Microsoft Building 11
Feb 3, 2026
Post comments count 0
Post likes count 2

Some small stories about the giant satellite dish antenna that was behind Microsoft Building 11

Raymond Chen
Raymond Chen

A little trivia.

Studying compiler error messages closely: Input file paths
Feb 2, 2026
Post comments count 5
Post likes count 1

Studying compiler error messages closely: Input file paths

Raymond Chen
Raymond Chen

Are you even compiling the correct file?

Why not store the <CODE>SAFEARRAY</CODE> reference count as a hidden allocation next to the <CODE>SAFEARRAY</CODE>?
Jan 30, 2026
Post comments count 1
Post likes count 1

Why not store the SAFEARRAY reference count as a hidden allocation next to the SAFEARRAY?

Raymond Chen
Raymond Chen

The case of "Bring your own <CODE>SAFEARRAY</CODE>."

How can I retain access to the data in a <CODE>SAFEARRAY</CODE> after my method returns?
Jan 29, 2026
Post comments count 1
Post likes count 2

How can I retain access to the data in a SAFEARRAY after my method returns?

Raymond Chen
Raymond Chen

Find a way to take ownership.

Why did I lose the data even though I called <CODE>Safe­Array­Add­Ref</CODE>?
Jan 28, 2026
Post comments count 0
Post likes count 1

Why did I lose the data even though I called Safe­Array­Add­Ref?

Raymond Chen
Raymond Chen

You have to use the original pointer, but even that won't be good enough.

A digression on the design and implementation of <CODE>Safe­Array­Add­Ref</CODE> and extending APIs in general
Jan 27, 2026
Post comments count 2
Post likes count 2

A digression on the design and implementation of Safe­Array­Add­Ref and extending APIs in general

Raymond Chen
Raymond Chen

The concerns when adding a feature to an existing API.

What’s the difference between <CODE>Safe­Array­Access­Data</CODE> and <CODE>Safe­Array­Add­Ref</CODE>?
Jan 26, 2026
Post comments count 0
Post likes count 3

What’s the difference between Safe­Array­Access­Data and Safe­Array­Add­Ref?

Raymond Chen
Raymond Chen

Two ways of preserving the data.

C++ has <CODE>scope_exit</CODE> for running code at scope exit. C# says “We have <CODE>scope_exit</CODE> at home.”
Jan 23, 2026
Post comments count 15
Post likes count 5

C++ has scope_exit for running code at scope exit. C# says “We have scope_exit at home.”

Raymond Chen
Raymond Chen

You can wrap it in an <CODE>IDisposable</CODE>.

A simple helper function for attaching a progress handler to a Windows Runtime IAsync­Action­With­Progress or IAsync­Operation­With­Progress
Jan 22, 2026
Post comments count 6
Post likes count 3

A simple helper function for attaching a progress handler to a Windows Runtime IAsync­Action­With­Progress or IAsync­Operation­With­Progress

Raymond Chen
Raymond Chen

It doesn't do much, but it saves typing.

On the proper usage of a custom Win32 dialog class
Jan 21, 2026
Post comments count 2
Post likes count 2

On the proper usage of a custom Win32 dialog class

Raymond Chen
Raymond Chen

You are replacing the window procedure, not the dialog procedure.

Microspeak: On fire, putting out fires
Jan 20, 2026
Post comments count 5
Post likes count 2

Microspeak: On fire, putting out fires

Raymond Chen
Raymond Chen

Dealing with emergencies.

What was the secret sauce that allows for a faster restart of Windows 95 if you hold the shift key?
Jan 19, 2026
Post comments count 8
Post likes count 6

What was the secret sauce that allows for a faster restart of Windows 95 if you hold the shift key?

Raymond Chen
Raymond Chen

An old flag from 16-bit Windows.

How can I get the tab index number from a dialog box control?
Jan 16, 2026
Post comments count 1
Post likes count 2

How can I get the tab index number from a dialog box control?

Raymond Chen
Raymond Chen

The tab index number is an authoring concept, not a runtime concept.

When programs assume that the system will never change, episode 4: Stealing strings
Jan 15, 2026
Post comments count 26
Post likes count 4

When programs assume that the system will never change, episode 4: Stealing strings

Raymond Chen
Raymond Chen

The strings are an implementation detail.

Clipping the focus item when looking for its on-screen location, part 3
Jan 14, 2026
Post comments count 0
Post likes count 1

Clipping the focus item when looking for its on-screen location, part 3

Raymond Chen
Raymond Chen

Finding <I>all</I> the clipping parents.

Clipping the focus item when looking for its on-screen location, part 2
Jan 13, 2026
Post comments count 1
Post likes count 2

Clipping the focus item when looking for its on-screen location, part 2

Raymond Chen
Raymond Chen

Finding the correct clipping parent.

Clipping the focus item when looking for its on-screen location
Jan 12, 2026
Post comments count 0
Post likes count 2

Clipping the focus item when looking for its on-screen location

Raymond Chen
Raymond Chen

Preventing the cursor from pointing to nothing.

Using Active Accessibility to find out where the focus item is
Jan 9, 2026
Post comments count 1
Post likes count 1

Using Active Accessibility to find out where the focus item is

Raymond Chen
Raymond Chen

Looking at child objects.