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

Determining how each Explorer window is sorted

Today’s Little Program lists all the open Explorer windows and their current sort criteria. (I will refrain from mentioning how auto-sort makes this meaningful.) Remember that Little Programs do...

View Article


Why are Windows setup logs stored in a Panther directory? Does it have...

Some time ago, I discussed the fates of the various cat projects that led to Windows 95, which was in turn a follow-up to a list of cat-related code names from projects that led to Windows 95. In...

View Article


Why is my call to ChangeTimerQueueTimer having no effect? (And another case...

A customer had a question about the Change­Timer­Queue­Timer function, and they shared a sample program that demonstrated the issue. (Hooray for reduction.) #include <windows.h> #include...

View Article

2015 year-end link clearance

The year-end link clearance is here! You may have noticed that the link clearances are getting shorter and shorter. I may have to cut back to only one link clearance per year. Not Even Close: The...

View Article

If you want to receive a message that is broadcast to top-level windows, you...

A customer wanted to suppress autorun from a wizard page. They started with this page on MSDN but found that their wizard page did not receive the Query­Cancel­Auto­Play message. default: if...

View Article


So how bad is it that I’m calling RegOpenKey instead of RegOpenKeyEx?

A customer had some code that called the Reg­Open­Key function and was concerned by the remark in MSDN: Note This function is provided only for compatibility with 16-bit versions of Windows....

View Article

What does the /V (verify) flag to XCOPY mean, and how did it get that way?

The XCOPY command has a flag called /V, which stands for verify. Sort of. /V Verifies the size of each new file. First, the easy question: What does this flag do? Answer: If this flag is set, then...

View Article

If I’m going to store a SID in a file, should I store the string form or the...

A customer needed to save some user SIDs into a file and wanted guidance on whether to use string format or binary format. Here are some pros and cons. String format: To save the SID, use the...

View Article


How can I tell whether my console program was launched from Explorer or from...

So you have a console program. This console program could be run by typing its name at the command prompt, or it could be run by the user double-clicking it from Explorer. And you want to know which...

View Article


Some senior executives are afraid to provide feedback, because they know that...

I recall a conversation I had with Steve Sinofsky, back when he was in charge of Windows. As you might expect, he gets to see early versions of a lot of things, his laptop is running dogfood...

View Article

Why does CryptDestroyHash crash, but only sometimes?

A customer was having a problem with the cryptographic hashing functions. They reported that their function ran successfully most of the time, but once in a while, it crashed at the call to...

View Article

Why is getting the HP_HASHSIZE so weird?

A comment on the documentation page for Crypt­Get­Hash­Param notes that the “obvious” way to get the HP_HASH­SIZE is incorrect. // Version 1: wrong. DWORD size = 0; if (CryptGetHashParam(hash,...

View Article

Does the thread pool have different handle access privileges? Why am I...

A customer was observing strange behavior in their application with handles and the thread pool. We have a service that spawns a child process, and under certain conditions, we need to terminate that...

View Article


A brief tour of the console alias functions

Today’s Little Program exercises the console alias functions. These functions let you define console aliases which are active when a target program reads a line of text from the console. The alias is...

View Article

What happened to the ability to use … (three dots) to refer to the...

In Windows 95, you could type cd ... to go up two directories, or cd .... to go up three directories, and so on. (You could also use triple-dots in paths passed to functions like Create­File.) Where...

View Article


Why does the date disappear from my taskbar, sometimes?

A customer reported that the date vanished from their taskbar, but it was there yesterday. They included a screen shot, which showed a vertically-docked taskbar on a Chinese system, and the clock...

View Article

A static_cast is not always just a pointer adjustment

Even without considering virtual base classes, a static_cast to move between a base class and a derived class can be more than just a pointer adjustment. Consider the following classes and functions....

View Article


How do I preload a chunk of memory into a memory-mapped file?

A customer had a moderate-sized memory-mapped file (a few dozen megabytes), and they wanted to preload the entire file into memory because their program accesses the contents of the file...

View Article

Changing a loop into a promise or task chain

If you are dealing with PPL Tasks in C++ or Promises in JavaScript, you run into the problem of having to rephrase loops in the form of callbacks. (On the other hand, if you’re using Tasks in C#, then...

View Article

How can I get the original shortcut target path with environment variables...

A customer wanted to be able to get the target of a shortcut with environment variables unexpanded. The IShellLink::Get­Path method will expand environment variables. The way to get the unexpanded...

View Article
Browsing all 3085 articles
Browse latest View live


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