Showing results for July 2014 - The Old New Thing

Jul 31, 2014
0
0

What is the strange garbage-looking string in the "command" value of a static verb?

Raymond Chen
Raymond Chen

A customer from a major software vendor asked, "What is the significance of the value that can be found under . It appears to be a copy of the default value, but with the program name replaced with apparent garbage. We've seen this both with Microsoft products as well as products by other companies. There is no mention of this value in the ...

Code
Jul 30, 2014
0
0

If you want to be notified when your app is uninstalled, you can do that from your uninstaller

Raymond Chen
Raymond Chen

A customer had a rather strange request. "Is there a way to be notified when the user uninstalls any program from Programs and Features (formerly known as Add and Remove Programs)?" They didn't explain what they wanted to do this for, and we immediately got suspicious. It sounds like the customer is trying to do something user-hostile, like seeing...

Code
Jul 29, 2014
0
0

Did the Windows 95 interface have a code name?

Raymond Chen
Raymond Chen

Commenter kinokijuf wonders whether the Windows 95 interface had a code name. Nope. We called it "the new shell" while it was under preliminary development, and when it got enabled in the builds, we just called it "the shell." (Explorer originally was named Cabinet, unrelated to the container file format of the same name. This original name ...

History
Jul 28, 2014
0
0

Finding the shortest path to the ground while avoiding obstacles

Raymond Chen
Raymond Chen

Today's Little Program solves the following problem: Consider a two-dimensional board, tall and narrow. Into the board are nailed a number of horizontal obstacles. Place a water faucet at the top of the board and turn it on. The water will dribble down, and when it hits an obstacle, some of the water will go left and some will go right. The goal...

Code
Jul 25, 2014
0
0

How do I obtain the computer manufacturer's name from C++?

Raymond Chen
Raymond Chen

Some time ago, I gave a scripting solution to the problem of obtaining the computer manufacturer and model. But what if you want to do this from C++? I could translate the script into C++, or I could just point you to Creating a WMI Application Using C++ in MSDN. In particular, one of the WMI C++ Sample Applications does exactly what you want...

Code
Jul 24, 2014
0
0

When I send a WM_GETFONT message to a window, why don't I get a font?

Raymond Chen
Raymond Chen

A customer reported that the message was not working. Specifically, they sent the message to a window, and they can plainly see that the window is rendering with a particular font, yet the message returns 0. Why isn't the window returning the correct font handle? The and messages are not mandatory. A window may choose to support them, or it ...

Code
Jul 23, 2014
0
0

When will GetSystemWindowsDirectory return something different from GetWindowsDirectory?

Raymond Chen
Raymond Chen

Most of the time, the returns the Windows directory. However, as noted in the documentation for : With Terminal Services, the Get­System­Windows­Directory function retrieves the path of the system Windows directory, while the Get­Windows­Directory function retrieves the path of a Windows directory that is private for each user...

Code
Jul 22, 2014
0
0

Microspeak: Tell Mode / Ask Mode

Raymond Chen
Raymond Chen

As a product nears release, the rate of change slows down, and along the way, the ship room goes through stages known as Tell Mode and Ask Mode. In Tell Mode, any changes to the product do not require prior approval, but you are required to present your changes to the next ship room meeting and be prepared to explain and defend them. The purpose ...

OtherMicrospeak
Jul 21, 2014
0
0

The alternate story of the time one of my colleagues debugged a line-of-business application for a package delivery service

Raymond Chen
Raymond Chen

Some people objected to the length, the structure, the metaphors, the speculation, and fabrication. So let's say they were my editors. Here's what the article might have looked like, had I taken their recommendations. (Some recommendations were to text that was also recommended cut. I applied the recommendations before cutting; the cuts are in ...

History
Jul 21, 2014
0
0

How can I get the URL to the Web page the clipboard was copied from?

Raymond Chen
Raymond Chen

When you copy content from a Web page to the clipboard and then paste it into OneNote, OneNote pastes the content but also annotates it "Pasted from ...". How does OneNote know where the content was copied from? As noted in the documentation for the HTML clipboard format, Web browsers can provide an optional property to specify the Web page ...

Code

Feedback