Even the boss got into the festivities. The post The Microsoft Company Party where everybody played name tag swap appeared first on The Old New Thing.
#old new thing
110 posts
9 Jun
8 Jun
Generalizing the shuffle to arbitrary numbers of blocks. The post Rotation revisited: Shuffling more than three blocks, and other small notes appeared first on The Old New Thing.
5 Jun
The back cover of C++: The Programming Language also raises questions not answered by the front cover
Raymond ChenNot doing the reading. The post The back cover of <I>C++: The Programming Language</I> also raises questions not answered by the front cover appeared first on The Old New Thing.
Rotation revisited: Avoiding having to calculate the gcd when doing cycle decomposition
Raymond ChenMath is hard. Let's go counting! The post Rotation revisited: Avoiding having to calculate the gcd when doing cycle decomposition appeared first on The Old New Thing.
4 Jun
Rotating in the minimum number of steps by performing cycle decomposition. The post Rotation revisited: Cycle decomposition in clang’s libcxx appeared first on The Old New Thing.
3 Jun
We've seen this before. The post Rotation revisited: A shocking discovery about gcc’s unidirectional rotation algorithm appeared first on The Old New Thing.
2 Jun
Moving in a straight line, in a different way. The post Rotation revisited: Another unidirectional algorithm appeared first on The Old New Thing.
1 Jun
Modern this and that. The post The placeholder name for the Windows 8 experience was “modern” appeared first on The Old New Thing.
29 May
Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 3
Raymond ChenA variation where we try only once. The post Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 3 appeared first on The Old New Thing.
28 May
Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 2
Raymond ChenJust let each person take turns trying. The post Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 2 appeared first on The Old New Thing.
27 May
Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 1
Raymond ChenCaching the result and knowing when the cache is valid. The post Sharing the result of a single Windows Runtime IAsyncOperation among multiple coroutines, part 1 appeared first on The Old New Thing.
26 May
If C# and JavaScript lets me await a Windows Runtime asynchronous operation more than once, why not C++/WinRT?
Raymond ChenA difference in philosophy. The post If C# and JavaScript lets me await a Windows Runtime asynchronous operation more than once, why not C++/WinRT? appeared first on The Old New Thing.
25 May
A hypothetical redesign of System.Diagnostics.Process to avoid confusion over properties that are valid only when you are the one who called Start
Raymond ChenPutting them in a place that can access only if you call Start. The post A hypothetical redesign of <CODE>System.<WBR>Diagnostics.<WBR>Process</CODE> to avoid confusion over properties that are valid only when you are the one who called <CODE>Start</CODE> appeared first on The Old New Thing.
22 May
Why do you say that a COM STA thread must pump messages if I see sample code creating STA threads and not pumping messages?
Raymond ChenYou need to pump messages when idle, but maybe you are never idle. The post Why do you say that a COM STA thread must pump messages if I see sample code creating STA threads and not pumping messages? appeared first on The Old New Thing.
21 May
Trick question: You can't. But maybe you can fake it. The post How do I use Win32 structures from the Windows Runtime? appeared first on The Old New Thing.
20 May
You need to arrange to get one from the other. The post The classic TreeView control lets me sort by name or by lParam, but why not both? appeared first on The Old New Thing.
19 May
The storage control blocks were destroyed. The post What is the history of the <CODE>ERROR_<WBR>ARENA_<WBR>TRASHED</CODE> error code? appeared first on The Old New Thing.
18 May
Reported incorrectly since the day it was written. The post Just shows that nobody cares about debugging the parity flag any more appeared first on The Old New Thing.
15 May
Maybe because it already exists? The post The case of the <CODE>CreateFileMapping</CODE> that always reported <CODE>ERROR_<WBR>ALREADY_<WBR>EXISTS</CODE> appeared first on The Old New Thing.
14 May
A constant-space linear-time algorithm for deleting all but the 10 most recent files in a directory
Raymond ChenUsing data structures you already knew. The post A constant-space linear-time algorithm for deleting all but the 10 most recent files in a directory appeared first on The Old New Thing.
13 May
Keeping things moving. The post The case of the hang when the user changed keyboard layouts appeared first on The Old New Thing.
12 May
Compatibility, of course. The post Why do Windows client editions on 32-bit x86 systems artificially limit RAM to 4 GB? appeared first on The Old New Thing.
11 May
Putting the handles in a private container. The post Additional notes on controlling which handles are inherited by <CODE>CreateProcess</CODE> appeared first on The Old New Thing.
8 May
You can track the file ID. The post Developing more confidence when tracking renames via <CODE>ReadDirectoryChangesW</CODE> appeared first on The Old New Thing.
7 May
When you upgrade your resource strings to Unicode, don’t forget to specify the L prefix
Raymond ChenOtherwise, it'll get mapped back down to the 8-bit code page. The post When you upgrade your resource strings to Unicode, don’t forget to specify the L prefix appeared first on The Old New Thing.
6 May
Static libraries don't stand a chance. The post Why not have changes in API behavior depend on the SDK you link against? appeared first on The Old New Thing.
5 May
A dispute over the TAB key highlights a mismatch between Microsoft and IBM organizational structures
Raymond ChenI want to speak to your manager. The post A dispute over the <KBD>TAB</KBD> key highlights a mismatch between Microsoft and IBM organizational structures appeared first on The Old New Thing.
4 May
You don't. All files are binary at the file system level. The post How do I inform Windows that I’m writing a binary file? appeared first on The Old New Thing.
1 May
Developing a cross-process reader/writer lock with limited readers, part 4: Abandonment
Raymond ChenRecovering from death of the owner. The post Developing a cross-process reader/writer lock with limited readers, part 4: Abandonment appeared first on The Old New Thing.
30 Apr
Let the exclusive acquisition have a fair chance against shared acquisitions. The post Developing a cross-process reader/writer lock with limited readers, part 3: Fairness appeared first on The Old New Thing.
29 Apr
Developing a cross-process reader/writer lock with limited readers, part 2: Taking turns when being grabby
Raymond ChenPlease, not everybody, everything all at once. The post Developing a cross-process reader/writer lock with limited readers, part 2: Taking turns when being grabby appeared first on The Old New Thing.
28 Apr
Developing a cross-process reader/writer lock with limited readers, part 1: A semaphore
Raymond ChenA pot of tokens. The post Developing a cross-process reader/writer lock with limited readers, part 1: A semaphore appeared first on The Old New Thing.
27 Apr
Looking at consequences of passing too few register parameters to a C function on various architectures
Raymond ChenIt's bad news no matter how you slice it, but Itanium makes it even worse. The post Looking at consequences of passing too few register parameters to a C function on various architectures appeared first on The Old New Thing.
24 Apr
But maybe it's not worth it. The post Defending against exceptions in a <CODE>scope_exit</CODE> RAII type appeared first on The Old New Thing.
23 Apr
Inadvertently destroying a staircase while standing on it. The post Another crash caused by uninstaller code injection into Explorer appeared first on The Old New Thing.
22 Apr
So-called "fractal page mapping". The post Mapping the page tables into memory via the page tables appeared first on The Old New Thing.
21 Apr
Somehow xor became the most popular version. The post Sure, xor’ing a register with itself is the idiom for zeroing it out, but why not sub? appeared first on The Old New Thing.
20 Apr
How did code handle 24-bit-per-pixel formats when using video cards with bank-switched memory?
Raymond ChenYou still have to use aligned accesses, even though the pixels might not be aligned. The post How did code handle 24-bit-per-pixel formats when using video cards with bank-switched memory? appeared first on The Old New Thing.
17 Apr
Preallocating memory to avoid quadratic behavior. The post Forgotten message from the past: <CODE>LB_<WBR>INITSTORAGE</CODE> appeared first on The Old New Thing.
16 Apr
Trespassing on system messages. The post What’s up with window message <CODE>0x0091</CODE>? We’re getting it with unexpected parameters appeared first on The Old New Thing.
15 Apr
Why is there a long delay between a thread exiting and the WaitForSingleObject returning?
Raymond ChenMaybe it didn't really exit. The post Why is there a long delay between a thread exiting and the <CODE>WaitForSingleObject</CODE> returning? appeared first on The Old New Thing.
14 Apr
Not a direct line to Bill Gates's office. The post Why was there a red telephone at every receptionist desk? appeared first on The Old New Thing.
13 Apr
Taking advantage of special characteristics of the array. The post Finding a duplicated item in an array of <VAR>N</VAR> integers in the range 1 to <VAR>N</VAR> − 1 appeared first on The Old New Thing.
10 Apr
Waiting for the waiting thread to acknowledge the change. The post How do you add or remove a handle from an active <CODE>WaitForMultipleObjects</CODE>?, part 2 appeared first on The Old New Thing.
9 Apr
You can't, but you can cooperate with the other thread. The post How do you add or remove a handle from an active <CODE>WaitForMultipleObjects</CODE>? appeared first on The Old New Thing.
8 Apr
You can't, but you can arrange for the waiter to do it for you. The post How do you add or remove a handle from an active <CODE>MsgWaitForMultipleObjects</CODE>? appeared first on The Old New Thing.
7 Apr
Were there any Windows 3.1 programs that were so incompatible with Windows 95 that there was no point trying to patch them?
Raymond ChenThe permanently ineligible list. The post Were there any Windows 3.1 programs that were so incompatible with Windows 95 that there was no point trying to patch them? appeared first on The Old New Thing.
6 Apr
If the compiler is complaining about things you didn't write, find out who wrote them. The post Learning to read C++ compiler errors: Illegal use of <TT>-></TT> when there is no <TT>-></TT> in sight appeared first on The Old New Thing.
3 Apr
How can I use ReadDirectoryChangesW to know when someone is copying a file out of the directory?
Raymond ChenFile copying is not a fundamental operation, nor is it even detectable at the file system layer. The post How can I use <CODE>ReadDirectoryChangesW</CODE> to know when someone is copying a file out of the directory? appeared first on The Old New Thing.
2 Apr
Why doesn’t the system let you declare your own messages to have the same semantics as WM_COPYDATA?
Raymond ChenTempting but misleading. The post Why doesn’t the system let you declare your own messages to have the same semantics as <CODE>WM_<WBR>COPYDATA</CODE>? appeared first on The Old New Thing.
1 Apr
What are we reading about here? The post The cover of <I>C++: The Programming Language</I> raises questions not answered by the cover appeared first on The Old New Thing.
31 Mar
Before you check if an update caused your problem, check that it wasn’t a problem before the update
Raymond ChenIt was going to be like that when I got here. The post Before you check if an update caused your problem, check that it wasn’t a problem before the update appeared first on The Old New Thing.
30 Mar
A question about the maximimum number of values in a registry key raises questions about the question
Raymond ChenWhy is this even a question? The post A question about the maximimum number of values in a registry key raises questions about the question appeared first on The Old New Thing.
27 Mar
You can steal them from your owner. The post What if a dialog wants to intercept its own message loop? appeared first on The Old New Thing.
26 Mar
Because it opted out. The post Why doesn’t <CODE>WM_<WBR>ENTERIDLE</CODE> work if the dialog box is a <CODE>MessageBox</CODE>? appeared first on The Old New Thing.
25 Mar
How can I change a dialog box’s message loop to do a MsgWaitForMultipleObjects instead of GetMessage?
Raymond ChenThe dialog box lets you change how it waits. The post How can I change a dialog box’s message loop to do a <CODE>MsgWaitForMultipleObjects</CODE> instead of <CODE>GetMessage</CODE>? appeared first on The Old New Thing.
24 Mar
A very primitive version of recovery. The post Windows 95 defenses against installers that overwrite a file with an older version appeared first on The Old New Thing.
23 Mar
You'll have to ask nicely. The post How can I make sure the anti-malware software doesn’t terminate my custom service? appeared first on The Old New Thing.
20 Mar
Wrapping things up. The post Windows stack limit checking retrospective: arm64, also known as AArch64 appeared first on The Old New Thing.
19 Mar
Reaching the modern day. The post Windows stack limit checking retrospective: amd64, also known as x86-64 appeared first on The Old New Thing.
18 Mar
Double the size, double the fun. The post Windows stack limit checking retrospective: Alpha AXP appeared first on The Old New Thing.
17 Mar
Appeasing the invisible return address predictor. The post Windows stack limit checking retrospective: x86-32 also known as i386, second try appeared first on The Old New Thing.
16 Mar
Doing the math backwards. The post Windows stack limit checking retrospective: PowerPC appeared first on The Old New Thing.
13 Mar
Optimizing out the unnecessary probes comes with its own complexity. The post Windows stack limit checking retrospective: MIPS appeared first on The Old New Thing.
12 Mar
One of the weirdest calling conventions you'll see. The post Windows stack limit checking retrospective: x86-32, also known as i386 appeared first on The Old New Thing.
11 Mar
Don't take steps that are too large. The post How do compilers ensure that large stack allocations do not skip over the guard page? appeared first on The Old New Thing.
10 Mar
Oh, this old thing? The post A snappy answer when asked about dressing casually at IBM appeared first on The Old New Thing.
9 Mar
Think fast, no pressure. The post The fine print giveth and the bold print taketh away: The countdown timer appeared first on The Old New Thing.
Look for the conflicting definitions to see where they are coming from. The post Learning to read C++ compiler errors: Ambiguous overloaded operator appeared first on The Old New Thing.
6 Mar
When ReadDirectoryChangesW reports that a deletion occurred, how can I learn more about the deleted thing?
Raymond ChenIt's already gone. If you need more information, you should have been remembering it. The post When <CODE>ReadDirectoryChangesW</CODE> reports that a deletion occurred, how can I learn more about the deleted thing? appeared first on The Old New Thing.
5 Mar
The mystery of the posted message that was dispatched before reaching the main message loop
Raymond ChenPerhaps it's because you dispatched it. The post The mystery of the posted message that was dispatched before reaching the main message loop appeared first on The Old New Thing.
4 Mar
Aha, I found a counterexample to the documentation that says that QueryPerformanceCounter never fails
Raymond ChenOf course, anything can happen if you break the rules. The post Aha, I found a counterexample to the documentation that says that <CODE>QueryPerformanceCounter</CODE> never fails appeared first on The Old New Thing.
3 Mar
Just some useless trivia. The post Just for fun: A survey of write protect notches on floppy disks and other media appeared first on The Old New Thing.
2 Mar
What sort of horrible things happen if my dialog has a non-button with the control ID of IDCANCEL?
Raymond ChenYou get notifications that might not make sense. The post What sort of horrible things happen if my dialog has a non-button with the control ID of <CODE>IDCANCEL</CODE>? appeared first on The Old New Thing.
27 Feb
Making sure it triggers when you need it, and not when you don't. The post Intercepting messages inside <CODE>IsDialogMessage</CODE>, fine-tuning the message filter appeared first on The Old New Thing.
26 Feb
Using an IsDialogMessage extension point. The post Intercepting messages inside <CODE>IsDialogMessage</CODE>, installing the message filter appeared first on The Old New Thing.
25 Feb
Process the message before you let IsDialogMessage see it. The post Intercepting messages before <CODE>IsDialogMessage</CODE> can process them appeared first on The Old New Thing.
24 Feb
Intercepting the flow in your message loop. The post Customizing the ways the dialog manager dismisses itself: Isolating the Close pathway appeared first on The Old New Thing.
23 Feb
Customizing the ways the dialog manager dismisses itself: Detecting the ESC key, second (failed) attempt
Raymond ChenSniffing the synchronous keyboard state is still not precise enough. The post Customizing the ways the dialog manager dismisses itself: Detecting the ESC key, second (failed) attempt appeared first on The Old New Thing.
20 Feb
The pocket reference guide for 2026/2027. The post The 2026/2027 Seattle Symphony subscription season at a glance appeared first on The Old New Thing.
Customizing the ways the dialog manager dismisses itself: Detecting the ESC key, first (failed) attempt
Raymond ChenSniffing the asynchronous keyboard state. The post Customizing the ways the dialog manager dismisses itself: Detecting the ESC key, first (failed) attempt appeared first on The Old New Thing.
19 Feb
Summarizing the flow. The post Exploring the signals the dialog manager uses for dismissing a dialog appeared first on The Old New Thing.
18 Feb
I guess it could, but why bother? The post Could <CODE>WriteProcessMemory</CODE> be made faster by avoiding the intermediate buffer? appeared first on The Old New Thing.
17 Feb
Final build, final, final, final 2, ship this one. The post Microspeak: Escrow appeared first on The Old New Thing.
16 Feb
It rather involved being on the other side of the airtight hatchway: Tricking(?) a program into reading files
Raymond ChenIs it really a trick when reading the file is the purpose of the program? The post It rather involved being on the other side of the airtight hatchway: Tricking(?) a program into reading files appeared first on The Old New Thing.
13 Feb
How can I distinguish between the numeric keypad 0 and the top-row 0 in the WM_CHAR message?
Raymond ChenSee if it matches the scan code. The post How can I distinguish between the numeric keypad 0 and the top-row 0 in the <CODE>WM_<WBR>CHAR</CODE> message? appeared first on The Old New Thing.
12 Feb
How can I distinguish between the numeric keypad 0 and the top-row 0 in the WM_KEYDOWN message?
Raymond ChenCheck whether it is an extended key. The post How can I distinguish between the numeric keypad 0 and the top-row 0 in the <CODE>WM_<WBR>KEYDOWN</CODE> message? appeared first on The Old New Thing.
11 Feb
How do I suppress the hover effects when I put a Win32 common controls ListView in single-click mode?
Raymond ChenYou can prevent the item from becoming hot-tracked. The post How do I suppress the hover effects when I put a Win32 common controls ListView in single-click mode? appeared first on The Old New Thing.
10 Feb
Asking nicely, and asking a lot of people. The post How did Windows 95 get permission to put the Weezer video <I>Buddy Holly</I> on the CD? appeared first on The Old New Thing.
9 Feb
It's your one chance to make amends. The post What should I do if a wait call reports <CODE>WAIT_<WBR>ABANDONED</CODE>? appeared first on The Old New Thing.
6 Feb
How can I prevent the user from changing the widths of ListView columns in version 5 of the common controls?, part 2
Raymond ChenPreventing the resize cursor from appearing. The post How can I prevent the user from changing the widths of ListView columns in version 5 of the common controls?, part 2 appeared first on The Old New Thing.
5 Feb
How can I prevent the user from changing the widths of ListView columns in version 5 of the common controls?
Raymond ChenDeny changes to the width. The post How can I prevent the user from changing the widths of ListView columns in version 5 of the common controls? appeared first on The Old New Thing.
4 Feb
Betting classical music. The post Super Bowl LX creates an opportunity for symphonic friendly wagering appeared first on The Old New Thing.
You can ask the header to be non-resizing. The post How can I prevent the user from changing the widths of ListView columns? appeared first on The Old New Thing.
3 Feb
Some small stories about the giant satellite dish antenna that was behind Microsoft Building 11
Raymond ChenA little trivia. The post Some small stories about the giant satellite dish antenna that was behind Microsoft Building 11 appeared first on The Old New Thing.
2 Feb
Are you even compiling the correct file? The post Studying compiler error messages closely: Input file paths appeared first on The Old New Thing.
30 Jan
Why not store the SAFEARRAY reference count as a hidden allocation next to the SAFEARRAY?
Raymond ChenThe case of "Bring your own SAFEARRAY." The post Why not store the <CODE>SAFEARRAY</CODE> reference count as a hidden allocation next to the <CODE>SAFEARRAY</CODE>? appeared first on The Old New Thing.
29 Jan
Find a way to take ownership. The post How can I retain access to the data in a <CODE>SAFEARRAY</CODE> after my method returns? appeared first on The Old New Thing.
28 Jan
You have to use the original pointer, but even that won't be good enough. The post Why did I lose the data even though I called <CODE>SafeArrayAddRef</CODE>? appeared first on The Old New Thing.
27 Jan
A digression on the design and implementation of SafeArrayAddRef and extending APIs in general
Raymond ChenThe concerns when adding a feature to an existing API. The post A digression on the design and implementation of <CODE>SafeArrayAddRef</CODE> and extending APIs in general appeared first on The Old New Thing.
26 Jan
Two ways of preserving the data. The post What’s the difference between <CODE>SafeArrayAccessData</CODE> and <CODE>SafeArrayAddRef</CODE>? appeared first on The Old New Thing.
23 Jan
C++ has scope_exit for running code at scope exit. C# says “We have scope_exit at home.”
Raymond ChenYou can wrap it in an IDisposable. The post C++ has <CODE>scope_exit</CODE> for running code at scope exit. C# says “We have <CODE>scope_exit</CODE> at home.” appeared first on The Old New Thing.
22 Jan
A simple helper function for attaching a progress handler to a Windows Runtime IAsyncActionWithProgress or IAsyncOperationWithProgress
Raymond ChenIt doesn't do much, but it saves typing. The post A simple helper function for attaching a progress handler to a Windows Runtime IAsyncActionWithProgress or IAsyncOperationWithProgress appeared first on The Old New Thing.
21 Jan
You are replacing the window procedure, not the dialog procedure. The post On the proper usage of a custom Win32 dialog class appeared first on The Old New Thing.
20 Jan
Dealing with emergencies. The post Microspeak: On fire, putting out fires appeared first on The Old New Thing.
19 Jan
What was the secret sauce that allows for a faster restart of Windows 95 if you hold the shift key?
Raymond ChenAn old flag from 16-bit Windows. The post What was the secret sauce that allows for a faster restart of Windows 95 if you hold the shift key? appeared first on The Old New Thing.
16 Jan
The tab index number is an authoring concept, not a runtime concept. The post How can I get the tab index number from a dialog box control? appeared first on The Old New Thing.
15 Jan
The strings are an implementation detail. The post When programs assume that the system will never change, episode 4: Stealing strings appeared first on The Old New Thing.
14 Jan
Finding all the clipping parents. The post Clipping the focus item when looking for its on-screen location, part 3 appeared first on The Old New Thing.
13 Jan
Finding the correct clipping parent. The post Clipping the focus item when looking for its on-screen location, part 2 appeared first on The Old New Thing.