#define WIN32_LEAN_AND_MEAN
#include <windows.h>
int __cdecl WinMainCRTStartup(void)
{
char *lpszCmdLine, *pChar;
pChar = GetCommandLine();
if (*pChar == '"') {
pChar++;
while (*pChar && *pChar != '"')
pChar++;
pChar++;
} else {
while (*pChar && *pChar != ' ')
pChar++;
}
if (*pChar <= ' ')
pChar++;
lpszCmdLine = pChar;
MessageBox(0, lpszCmdLine, 0, MB_OK);
ExitProcess(0);
}
Silly example using msvcrt.dll#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#pragma comment (lib, "msvcrt.lib")
int __cdecl WinMainCRTStartup(void)
{
int __cdecl __getmainargs(int*, char***, char***, int, int*);
int argc;
char** argv;
char** env;
int new_mode = 0;
__getmainargs(&argc,&argv,&env,0,&new_mode);
MessageBox(0, argv[0], 0, 0);
if (argc>1) {
MessageBox(0, argv[1], 0, 0);
}
ExitProcess(0);
}