The Old New Thing

Going for the facts: Who is displaying this message box?

A customer wanted to know whether had a problem with Unicode. A problem with it? Quite the contrary. loves Unicode! In fact, if you call the ANSI version, it converts the strings to Unicode and then finishes the work in Unicode. Okay, here's the customer's problem. We have a custom application written in managed code. When we launch ...

How do I show the contents of a directory while respecting the user's preferences for hidden and super-hidden files as well as the user's language preferences?

A customer was writing a program in (and this is what they said) "32 bit C++ .Net 4.0" which displayed the contents of a directory, and they wanted to filter out items such as hidden files and protected operating system files (also known as super-hidden files) based on the user's current Explorer preferences. Furthermore, they wanted to show ...

How do I create an IShellItemArray from a bunch of file paths?

The interface accepts bulk operations in the form of an . So how do you take a list of file names and convert them into an ? There is no function, but there is a , and we know how to convert a path to an ID list, namely via . So lets snap two blocks together. The template function takes an array of paths and starts by creating a ...

Programmatically uploading a file to an FTP site

Today's Little Program uploads a file to an FTP site in binary mode with the assistance of the Wininet library. This program has sat in my bag of tools for years. The program accepts five command line arguments: site (no "ftp://" in front) userid password path for the file to upload location to place the uploaded file For example, I ...

Adventures in automation: Dismissing all message boxes from a particular application but only if they say that the operation succeeded

Suppose you have a program that is part of your workflow, and it has the annoying habit of showing a message box when it is finished. You want to automate this workflow, and part of that automation is dismissing the message box. Let's start by writing the annoying program: This annoying program pretends to do work for a little while, and...