The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Finding a duplicated item in an array of <VAR>N</VAR> integers in the range 1 to <VAR>N</VAR> − 1
Apr 13, 2026
Post comments count 3
Post likes count 1

Finding a duplicated item in an array of N integers in the range 1 to N − 1

Image
Raymond Chen

Taking advantage of special characteristics of the array.

How do you add or remove a handle from an active <CODE>Wait­For­Multiple­Objects</CODE>?, part 2
Apr 10, 2026
Post comments count 3
Post likes count 2

How do you add or remove a handle from an active Wait­For­Multiple­Objects?, part 2

Image
Raymond Chen

Waiting for the waiting thread to acknowledge the change.

How do you add or remove a handle from an active <CODE>Wait­For­Multiple­Objects</CODE>?
Apr 9, 2026
Post comments count 4
Post likes count 2

How do you add or remove a handle from an active Wait­For­Multiple­Objects?

Image
Raymond Chen

You can't, but you can cooperate with the other thread.

How do you add or remove a handle from an active <CODE>Msg­Wait­For­Multiple­Objects</CODE>?
Apr 8, 2026
Post comments count 4
Post likes count 2

How do you add or remove a handle from an active Msg­Wait­For­Multiple­Objects?

Image
Raymond Chen

You can't, but you can arrange for the waiter to do it for you.

Were there any Windows 3.1 programs that were so incompatible with Windows 95 that there was no point trying to patch them?
Apr 7, 2026
Post comments count 9
Post likes count 6

Were there any Windows 3.1 programs that were so incompatible with Windows 95 that there was no point trying to patch them?

Image
Raymond Chen

The permanently ineligible list.

Learning to read C++ compiler errors: Illegal use of <TT>-></TT> when there is no <TT>-></TT> in sight
Apr 6, 2026
Post comments count 3
Post likes count 2

Learning to read C++ compiler errors: Illegal use of -> when there is no -> in sight

Image
Raymond Chen

If the compiler is complaining about things you didn't write, find out who wrote them.

How can I use <CODE>Read­Directory­ChangesW</CODE> to know when someone is copying a file out of the directory?
Apr 3, 2026
Post comments count 3
Post likes count 2

How can I use Read­Directory­ChangesW to know when someone is copying a file out of the directory?

Image
Raymond Chen

File copying is not a fundamental operation, nor is it even detectable at the file system layer.

Why doesn’t the system let you declare your own messages to have the same semantics as <CODE>WM_<WBR>COPY­DATA</CODE>?
Apr 2, 2026
Post comments count 0
Post likes count 4

Why doesn’t the system let you declare your own messages to have the same semantics as WM_COPY­DATA?

Image
Raymond Chen

Tempting but misleading.

The cover of <I>C++: The Programming Language</I> raises questions not answered by the cover
Apr 1, 2026
Post comments count 17
Post likes count 14

The cover of C++: The Programming Language raises questions not answered by the cover

Image
Raymond Chen

What are we reading about here?