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

Image may be NSFW.
Clik here to view.

The mystery of the icon that never appears

A customer reported a problem showing an icon on their dialog box. We verified that this code does execute during the handling of the WM_INIT­DIALOG message. No assertion fires, yet no icon appears...

View Article


Image may be NSFW.
Clik here to view.

Is WriteProcessMemory atomic?

A customer asked, "Does Write­Process­Memory write the memory atomically? I mean, if I used Write­Process­Memory to write 10 instructions for a total of 20 bytes, can Write­Process­Memory wrote those...

View Article


Image may be NSFW.
Clik here to view.

An extensible interlocked arithmetic function (via lambdas)

Some time ago, I noted that you can build other interlocked operations out of Interlocked­Compare­Exchange. Here's an example: using System.Threading; public static int InterlockedMax(ref int...

View Article

Image may be NSFW.
Clik here to view.

Creating a simple shell item, just as fake as a simple pidl

Continuing from Creating a simple pidl: For the times you care enough to send the very fake: Instead of creating a simple pidl, we'll create a simple shell item. The idea is the same. We build a file...

View Article

Image may be NSFW.
Clik here to view.

The code names for various subprojects within Windows 95

Most people know that Windows 95 was code-named Chicago. The subprojects of Windows 95 also had their code names, in part because code names are cool, and in part because these projects were already...

View Article


Image may be NSFW.
Clik here to view.

Dialog boxes return focus to the control that had focus when you last...

When you switch away from a dialog box, and then switch back to the dialog box, focus returns to the control that had focus when you last left the dialog box. But if you have a window that manually...

View Article

Image may be NSFW.
Clik here to view.

Why does my radio button group selection get reset each time my window...

A customer reported (all incomplete information and red herrings preserved): We have an issue related to two radio buttons in a window. The code programmatically checks the second button by sending the...

View Article

Image may be NSFW.
Clik here to view.

Eventually, we may find out where notes eight through twelve came from

CBC Radio's Tom Allen investigates the origin of the opening four notes of the classic Star Trek theme. He traces it to the opening of Mahler's First Symphony, then further back to Brahms's Second...

View Article


Image may be NSFW.
Clik here to view.

Why is the debugger telling me I crashed because my DLL was unloaded, when I...

A customer was puzzled by what appeared to be contradictory information coming from the debugger. We have Windows Error Reporting failures that tell us that we are executing code in our DLL which has...

View Article


Image may be NSFW.
Clik here to view.

Find the index of the smallest element in a JavaScript array

Today's Little Program isn't even a program. It's just a function. The problem statement is as follows: Given a nonempty JavaScript array of numbers, find the index of the smallest value. (If the...

View Article

Image may be NSFW.
Clik here to view.

Only senior executives can send email to the All Employees distribution list,...

Some time ago, a senior executive sent email to the All Employees distribution list at Microsoft announcing that a particular product was now available for dogfood. The message included a brief...

View Article

Image may be NSFW.
Clik here to view.

Cargo-cult registry settings and the people who swear by them

Two customers (so far) wanted to know how to increase the duration of taskbar balloon notifications on Windows Vista. (By the way, I gave the answer some time ago.) They claimed that on Windows XP,...

View Article

Image may be NSFW.
Clik here to view.

How to take down the entire Internet with this one weird trick, according to...

According to the television documentary Crisis which aired on NBC last Sunday, a cyberattack took over the entire Internet. Timecode 13:00: "Anything connected to the Internet. Banking systems, power...

View Article


Image may be NSFW.
Clik here to view.

It rather involved being on the other side of this airtight hatchway: Denial...

We received the following security vulnerability report: Windows is vulnerable to a denial of service attack that consumes 100% CPU. Use the following procedure to create a file that is enchanted by...

View Article

Image may be NSFW.
Clik here to view.

Get your hex wrench ready, because here comes the Ikea bicycle

Ikea säljer elcyklar. Click through for two-image slide show. Ikea selling electric bicycles Forget furniture. Ikea is now launching, that's right, an electric bicycle.It goes under the name...

View Article


Image may be NSFW.
Clik here to view.

Why does GetFileVersionInfo map the whole image into memory instead of just...

Commenter acq responds (with expletive deleted), "the whole file is mapped into the process' memory only for version info that's certainly only a few kilobytes to be read?" Why not map only the parts...

View Article

Image may be NSFW.
Clik here to view.

Obtaining information about the user's wallpaper on multiple monitors

Today we're going to dump information about the user's wallpaper settings on multiple monitors. The idea is simple. You use the IDesktop­Wallpaper interface on the Desktop­Wallpaper object to get...

View Article


Image may be NSFW.
Clik here to view.

As long as your file names meet operating system requirements, you can use...

A customer had a question about the MSDN documentation on rules for legal file names: My employees keep naming documents with hyphens in the name. For example, they might name a file...

View Article

Image may be NSFW.
Clik here to view.

Why did it take so long for Windows to support a taskbar on more than one...

Mark wants to know why Windows has never supported having a taskbar on more than one monitor. (The question was asked before Windows 8 multi-monitor taskbar support became publically-known.) The...

View Article

Image may be NSFW.
Clik here to view.

Closing over the loop variable is just as harmful in JavaScript as it is in...

Prerequisite reading: Closing over the loop variable considered harmful. JavaScript has the same problem. Consider: function hookupevents() { for (var i = 0; i < 4; i++) {...

View Article
Browsing all 3085 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>