AssocQueryString and the Unknown Association

| No Comments

Most Apollo development for Windows is still being done on Windows XP, but we're testing against at least some of the versions of Windows Vista.

On Windows XP, we've been using AssocQueryString to find the application associated with a particular file extension. (AssocQueryString is a utility function in the Shell that retrieves information about file types.) This broke on Vista, where the call was returning an answer even if no application was associated with the file extension.

The solution is to add ASSOCF_IGNOREUNKNOWN to the flags parameter. Otherwise, on Vista, if a file type is not registered it may return you information about the "Unknown" application instead of just fessing up and admitting nothing is registered. Again, this is a change from XP, which would admit the truth without this flag.

One more thing: Although ASSOCF_IGNOREUNKNOWN is defined in the Platform SDK documentation, it may not be defined in older versions of the Windows headers. Actual value: 0x400.

Leave a comment

About this Entry

This page contains a single entry by Oliver Goldman published on May 14, 2007 11:30 AM.

Java is the New C was the previous entry in this blog.

Don't Rename that MSI is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.