Quantcast
Channel: The Old New Thing
Browsing all 1765 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

How do I get a handle to the primary monitor?

There are various ways of getting a monitor. You can get the monitor from a point, from a rectangle, or from a window. But how do you get the primary monitor? The primary monitor is defined to be the...

View Article


Image may be NSFW.
Clik here to view.

Raymond, why did you stop studying Chinese? It has no grammar!

One of my colleagues, a native Chinese speaker, asked me whether I was still learning Mandarin Chinese. I told him that I had given up. He was baffled by this. "But Chinese is such a simple language....

View Article


Image may be NSFW.
Clik here to view.

Why does an attempt to create a SysLink control in my plug-in sometimes fail?

A customer had written a plug-in for some application, and they found that their plug-in was unable to create a SysLink control via the Create­Window­ExW function. The same code in a standalone...

View Article

Image may be NSFW.
Clik here to view.

Kicking around a function that formats stuff

Today's "Little Program" is really a "Little Puzzle" that got out of hand. This started out as a practical question: This code fragment screams out for some sort of simplification. (I've changed the...

View Article

Image may be NSFW.
Clik here to view.

A little cheat in my Tiger Beat photo homage

One thing nobody has called out in my tribute to the Bill Gates Tiger Beat photo, either because it was too subtle or too obvious, is that the photo is actually a mirror image. The arrangement of...

View Article


Image may be NSFW.
Clik here to view.

How can I wait until all startup applications have finished launching?

A customer wanted to know how to detect that all startup applications have finished launching. They wanted to wait until everything settled down before proceeding with some task. What if two programs...

View Article

Image may be NSFW.
Clik here to view.

When does GetTickCount consider the system to have started?

The Get­Tick­Count and Get­Tick­Count­64 functions return "the number of milliseconds that have elapsed since the system was started." (The 32-bit version wraps around after around 50 days.) But when...

View Article

Image may be NSFW.
Clik here to view.

How to view the stack of a user-mode thread when its kernel stack has been...

Suppose you have a machine that has crashed, and your investigation shows that the reason is that there is a critical section that everybody is waiting for. While waiting for that critical section,...

View Article


Image may be NSFW.
Clik here to view.

How do I enumerate drives the same way that the NET USE command does?

If you use the Remote Desktop Connection client to connect to another computer, you have the option of making your local drives available to the remote computer. A customer wanted to know how to...

View Article


Image may be NSFW.
Clik here to view.

File version information does not appear in the property sheet for some files

A customer reported that file version information does not appear on the Details page of the property sheet which appears when you right-click the file and select Properties. They reported that the...

View Article

Image may be NSFW.
Clik here to view.

Distinguishing between normative and positive statements to help people...

Often, we get questions from a customer that use the word should in an ambiguous way: Our program creates a widget whose flux capacitor should have reverse polarity. Attached is a sample program that...

View Article

Image may be NSFW.
Clik here to view.

A library loaded via LOAD_LIBRARY_AS_DATAFILE (or similar flags) doesn't get...

If you load a library with the LOAD_LIBRARY_AS_DATA­FILE flag, then it isn't really loaded in any normal sense. In fact, it's kept completely off the books. If you load a library with the...

View Article

Image may be NSFW.
Clik here to view.

Is it wrong to call SHFileOperation from a service? Revised

My initial reaction to this question was to say, "I don't know if I'd call it wrong, but I'd call it highly inadvisable." I'd like to revise my guidance. It's flat-out wrong, at least in the case...

View Article


Image may be NSFW.
Clik here to view.

The crazy world of stripping diacritics

Today's Little Program strips diacritics from a Unicode string. Why? Hey, I said that Little Programs require little to no motivation. It might come in handy in a spam filter, since it was popular, at...

View Article

Image may be NSFW.
Clik here to view.

What is the difference between Full Windows Touch Support and Limited Touch...

In the System control panel and in the PC Info section of the PC & Devices section of PC Settings, your device's pen and touch support can be reported in a variety of ways. Here is the matrix: No...

View Article


Image may be NSFW.
Clik here to view.

If 16-bit Windows had a single input queue, how did you debug applications on...

After learning about the bad things that happened if you synchronized your application's input queue with its debugger, commenter kme wonders how debugging worked in 16-bit Windows, since 16-bit...

View Article

Image may be NSFW.
Clik here to view.

Some light reading on lock-free programming

Today is a holiday in the United States, so I'm going to celebrate by referring you to other things to read. I'm going to start with a presentation by Bruce Dawson at GDC 2009, which is basically...

View Article


Image may be NSFW.
Clik here to view.

A user's SID can change, so make sure to check the SID history

It doesn't happen often, but a user's SID can change. For example, when I started at Microsoft, my account was in the SYS-WIN4 domain, which is where all the people on the Windows 95 team were placed....

View Article

Image may be NSFW.
Clik here to view.

Counting array elements which are below a particular limit value using SSE

Some time ago, we looked at how doing something can be faster than not doing it. That is, we observed the non-classical effect of the branch predictor. I took the branch out of the inner loop, but...

View Article

Image may be NSFW.
Clik here to view.

Microspeak: Redlines

To the outside world, redline can mean to mark something for removal, or it could mean the maximum safe speed of an engine. But in the world of Microsoft design, the term redlines (pronounced as if it...

View Article
Browsing all 1765 articles
Browse latest View live