The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Nov 14, 2012
Post comments count 0
Post likes count 1

Break it up, you two!: The zero width non-joiner

Raymond Chen

Preventing characters from combining.

Nov 13, 2012
Post comments count 0
Post likes count 1

Microsoft Money crashes during import of account transactions or when changing a payee of a downloaded transaction

Raymond Chen

Update: An official fix for this issue has been released to Windows Update, although I must say that I think my patch has more style than the official one. You do not need to patch your binary. Just keep your copy of Windows 8 up to date and you'll be fine. For the five remaining Microsoft Money holdouts (meekly raises hand), here's a patch for a crashing bug during import of account transactions or when changing a payee of a downloaded transaction in Microsoft Money Sunset Deluxe. Patch the mnyob99.dll file as follows: File offset 003FACE8: Change 85 to 8D File offset 003FACED: Change 50 to 51 File of...

Nov 12, 2012
Post comments count 0
Post likes count 1

Frequentists vs Bayesians

Raymond Chen

But, I mean, c'mon. Frequentists vs Bayesians? Worst. Action. Movie. Ever.

Nov 12, 2012
Post comments count 0
Post likes count 1

Why are taskbar live previews lost when you use Fast User Switching?

Raymond Chen

Anonymous asks a metric buttload of questions, which means that I feel compelled to answer all or none. And given the choice, I decided to answer none. Okay, I will answer one and ignore the rest. Why are taskbar live previews lost when you use Fast User Switching? When you switch away from a user via Fast User Switching, the Desktop Window Manager for that session is turned off. After all, since that session no longer has access to the screen, there's no point running all this code and consuming all this memory for something nobody can see. When the Desktop Window Manager restarts upon reactivation of a ses...

Nov 9, 2012
Post comments count 0
Post likes count 1

Thread affinity of user interface objects: Addendum

Raymond Chen

Some time ago, I discussed the thread affinity of device contexts, noting that the and functions must be called from the same thread. The same restriction also applies to printer DCs. Printer DCs must be created and destroyed on the same thread. The printing team imposed this additional rule in order to make it easier for printer driver vendors to author their drivers. (Printer driver developers have a habit of calling in their implementation of and in their implementation of .) Given that printer drivers are a third-party extension point, it's probably in your best interest to treat printer DCs as havin...

Nov 8, 2012
Post comments count 0
Post likes count 1

What does the COINIT_SPEED_OVER_MEMORY flag to CoInitializeEx do?

Raymond Chen

One of the flags you can pass to is , which is documented as : Trade memory for speed. This documentation is already vague since it doesn't say which direction the trade is being made. Are you reducing memory to increase speed, or increasing memory by reducing speed? Actually it's neither: If you pass this flag, then you are instructing COM to consume more memory in an attempt to reduce CPU usage, under the assumption that you run faster by executing fewer cycles.¹ The request is a per-process one-way transition. Once anybody anywhere in the process puts COM into speed-over-memory mode, the flag stays ...

Nov 7, 2012
Post comments count 0
Post likes count 1

Instead of trying to create a filter that includes everything, try just omitting the filter

Raymond Chen

The question was sent to a peer-to-peer discussion group for an internal program, let's call it Program Q. I'll add additional context so you can follow along. Hi, I'm trying to build a query that finds all issues owned by a particular user, regardless of which product the issue belongs to. I know that I can query for specific products by saying Is there a better way to do this than just running the query for every product in the database? It would be great to find all the issues at one shot instead of having to issue dozens of commands and combine the results. The person who submitted this question go...

Nov 6, 2012
Post comments count 0
Post likes count 1

If you're asking somebody to help you, you want to make it easy for them, not harder

Raymond Chen

A customer liaison asked a question that went roughly like this: From: Liaison My customer is having a problem with the header file winfoo.h. The environment is Windows Vista German SP1 with Visual Studio 2008 Professional German SP1 and Windows SDK 6000.0.6000 German. When they try to include the file in their project, they get an error on line 42. "The character ';' was not expected here." Can somebody help? From: Raymond Can somebody please attach a copy of the offending file? There are many versions of winfoo.h, and it's not clear which version comes with Visual Studio 2008 Professional German SP1 +...

Nov 5, 2012
Post comments count 0
Post likes count 1

How do I get the tabbed dialog effect on my own custom tabbed dialog?

Raymond Chen

CJ observed that the standard tabbed dialogs provide an effect on the tab pages and want to know how to get the tabbed dialog effect on custom dialogs. fds242 noted this as well and wanted to know why the automatic tabbed dialog effect doesn't kick in until you put a static control on the child dialog box. Let's look at the first question first. To get the tabbed dialog effect, you can call with the flag. The best time to do this is in the handler, but you can also do it immediately after the dialog has been created. (Basically, you want to do this before the dialog paints for the first time, so as to avo...