The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

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 5
Post likes count 0

C++ has <CODE>scope_exit</CODE> for running code at scope exit. C# says “We have <CODE>scope_exit</CODE> 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 5
Post likes count 1

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 1

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 1

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 5

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.