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

Image may be NSFW.
Clik here to view.

Why was the replacement installer for recognized 16-bit installers itself a...

Even though 64-bit Windows does not support 16-bit applications, there is a special case for 16-bit installers for 32-bit applications. Windows detects this scenario and substitutes a 32-bit...

View Article


Image may be NSFW.
Clik here to view.

Who is this rogue operative that filled my object with 0xDD, then sent me a...

A failure occurred during stress testing, and the component team came to the conclusion that their component was actually the victim of memory corruption and they asked for help trying to see if there...

View Article


Image may be NSFW.
Clik here to view.

What is this inconsistent heap state that MSDN warns me about during...

In the MSDN documentation for the Dll­Main entry point, MSDN notes: When handling DLL_PROCESS_DETACH, a DLL should free resources such as heap memory only if the DLL is being unloaded dynamically (the...

View Article

Image may be NSFW.
Clik here to view.

Reading the word under the cursor via UI Automation

A while back, I showed how to use UI Automation to extract the text under the mouse cursor. Let's refine the program so it can extract the word under the cursor. The ability to extract subunits of...

View Article

Image may be NSFW.
Clik here to view.

The 2015/2016 Seattle Symphony subscription season at a glance

For many years, I've put together a little pocket guide to the Seattle Symphony subscription season for my symphony friends to help them decide which ticket package they want. For the past several...

View Article


Image may be NSFW.
Clik here to view.

Microspeak: Light up

In Microspeak, a feature lights up if it becomes available in an application when run on an operating system that supports it. The idea is that you write your application to run on, say, Windows...

View Article

Image may be NSFW.
Clik here to view.

When asking about the capacity of a program, you also need to consider what...

An internal customer had a question about a tool, let's call it Program Q. As part of our gated checkin system, the system creates a new record in a Program Q table to record details of the checkin....

View Article

Image may be NSFW.
Clik here to view.

What's the point of using a custom timer queue if there is a default one...

A customer observed that when you create a timer via Create­Timer­Queue­Timer, you have the option of passing either NULL to get the default timer queue or a handle to a custom timer queue created by...

View Article


Image may be NSFW.
Clik here to view.

Non-capturing C++ lambdas can be converted to a pointer to function, but what...

First, let's look at how lambdas are implemented in C++. It is similar in flavor to the way lambdas are implemented in C#, but the details are all different. When the C++ compiler encounters a lambda...

View Article


Image may be NSFW.
Clik here to view.

Further adventures in trying to guess what encoding a file is in

The Is­Text­Unicode function tries to guess the encoding of a block of memory purporting to contain text, but it can only say "Looks like Unicode" or "Doesn't look like Unicode", and there some...

View Article

Image may be NSFW.
Clik here to view.

Nice job, you got an A minus from Bill

Bill Gates does not praise lightly. Some time ago, a colleague of mine helped to prepared a keynote address for Bill Gates. Afterward, he was informed that Bill rated the presentation an "A minus". My...

View Article

Image may be NSFW.
Clik here to view.

Why does the mouse cursor jump a few pixels if you click on the very bottom...

ABCDSchuetze discovered that if you click on the very bottom row of pixels of the taskbar, the mouse cursor jumps up a few pixels. Why is that? In order to take advantage of Fitts's Law, the...

View Article

Image may be NSFW.
Clik here to view.

RegNotifyChangeKeyValue sucks less

One of the gotchas of the Reg­Notify­Change­Key­Value function is that the notification registration has thread affinity. This is a problem if you want the notification registration to outlive the...

View Article


Image may be NSFW.
Clik here to view.

Solving the problem rather than answering the question: How can a...

A customer opened with a question, which the customer liaison forwarded to the product group with High Priority. (Because, apparently, their customer is more important than any other customer.) Our...

View Article

Image may be NSFW.
Clik here to view.

Connecting some blocks: Tell me more about the current image in my wallpaper...

One of my colleagues said, I really like the wallpaper slide show feature, especially the one that rotates through the top-rated pictures in my photo library. My photo library includes photos taken by...

View Article


Image may be NSFW.
Clik here to view.

Setting up a new computer often results in leftover slot covers, so what do...

When I joined Microsoft, I had a brand new computer waiting for me. One of the rites of passage for new employees is setting up their computer. A colleague helped me out with this effort, and one of...

View Article

Image may be NSFW.
Clik here to view.

Why are the dimensions of a maximized window larger than the monitor?

When you inspect the window rectangle of a maximized window, you might notice that its dimension are actually slightly larger than the screen. The upper left corner is something like (−8, −8) and the...

View Article


Image may be NSFW.
Clik here to view.

Modifying the CS_NOCLOSE style does affect all windows of the class, just not...

In a discussion of how not to disable the Close button, Rick C claims that changing the style does not affect windows that are already created. Actually, it does. You can't see it, but the effect is...

View Article

Image may be NSFW.
Clik here to view.

A question about the FileTimeToLocalFileTime function turned out to be...

A customer reported that their program was running into problems with the File­Time­To­Local­File­Time function. Specifically, they found that the values reported by the function varied wildly for...

View Article

Image may be NSFW.
Clik here to view.

How can I programmatically resize a listview column to fit its contents?

Sven wanted to know if there is a listview message to resize a column to fit its contents. Sure there is. In fact, the default Ctrl+Num+ handler uses that message. Take our scratch program and make...

View Article
Browsing all 3085 articles
Browse latest View live


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