美文网首页
CommandLineToArgvW

CommandLineToArgvW

作者: 锦囊喵 | 来源:发表于2020-07-03 17:35 被阅读0次

Parses a Unicode command line string and returns an array of pointers to the command line arguments, along with a count of such arguments, in a way that is similar to the standard C run-time argv and argc values.

int __cdecl main() {
LPWSTR *szArglist;
int nArgs;
int i;
 
szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
if( NULL == szArglist ) {
wprintf(L"CommandLineToArgvW failed\n");
return 0;
}
else for( i=0; i<nArgs; i++) printf("%d: %ws\n", i, szArglist[i]);
 
// Free memory allocated for CommandLineToArgvW arguments.
 
LocalFree(szArglist);
 
return(1);
}

相关文章

网友评论

      本文标题:CommandLineToArgvW

      本文链接:https://www.haomeiwen.com/subject/wmxeqktx.html