- Just wondering, how could I compile a Windows program as Unicode or Non-Unicode? Is possible using, for example, mingw/gcc?
It's a matter of which API functions you link against. Define UNICODE and _UNICODE for all source files and you should get a Unicode binary. With MSVC++, there's an option you can set for each project to make it build in Unicode instead of ANSI/multibyte, which (I believe) does exactly this.
If you want to make both ANSI and Unicode builds of the same program, then you're going to have to use TCHAR (#include <tchar.h>, replace 'char' with 'TCHAR', put _T() around all strings, and substitute printf/fopen/strcpy/etc. with appropriate aliases) pretty much everywhere that talks to the operating system (except for stuff like logging, which you'll probably still want in ANSI).
Be warned, however, that this can be a very tedious process - I did this for Nintendulator, and it took me the better part of a week to get everything compiling and running properly in both modes (and even then, I still ended up missing a few spots).