Originally Posted by
Dave Evans
I have never heard or read (before this) that in some cases the user-supplied arguments can begin with argv[0]
This happens not with argv, but with lpCmdLine in the WinMain prototype, where lpCmdLine is the full string (spaces included) after the program name invocation:
Code:
int WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow);
//command line
mywin32prog.exe 1 2 3 4 me likes pie
//will result in
lpCmdLine = "1 2 3 4 me likes pie"
//or
argv[0] = "mywin32prog.exe"
argv[1] = "1"
argv[2] = "2"
argv[3] = "3"
argv[4] = "4"
argv[5] = "me"
argv[6] = "likes"
argv[7] = "pie"