See the question and my original answer on StackOverflow

Always use W (unicode) versions unless you really don't want to for some reason (some more recent APIs don't even have A versions). This is documented here: Conventions for Function Prototypes. I quote:

New Windows applications should use Unicode to avoid the inconsistencies of varied code pages and for ease of localization. They should be written with generic functions, and should define UNICODE to compile the functions into Unicode functions. In the few places where an application must work with 8-bit character data, it can make explicit use of the functions for Windows code pages.