Test this example in POIDE with commandline:
/1 "c:\pa\"th with blanks"\ /3 /4
with and without #define CON
and see what czerny has found
#define UNICODE
#define _UNICODE
#include <windows.h>
#include <wchar.h>
#include <stdio.h>
#include <shellapi.h>
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "shell32.lib")
//#define CON
#ifdef CON
#pragma comment(linker, "/SUBSYSTEM:CONSOLE")
int __cdecl mainCRTStartup(void)
#else
#pragma comment(linker, "/SUBSYSTEM:WINDOWS")
int __cdecl WinMainCRTStartup(void)
#endif
{
LPWSTR *szArglist;
int nArgs;
int i, idx;
TCHAR sTmp[1024];
idx = wsprintf(sTmp, TEXT("%ls\n"), GetCommandLineW());
OutputDebugString(sTmp);
szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
if (NULL == szArglist)
{
OutputDebugString(L"CommandLineToArgvW failed\n");
return 1;
}
else
for (i = 0; i < nArgs; i++)
idx += wsprintf(&sTmp[idx], TEXT("[%d] [%ls]\n"), i, szArglist[i]);
OutputDebugString(sTmp);
MessageBox(0, sTmp, 0, MB_OK);
LocalFree(szArglist);
return (0);
}