07/09/09 14:41
c0rv0
Ho provato a vedere come lavora lpCmdLine:
#include<stdio.h>
#include<windows.h>
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
LPSTR lpCmdLine, int nCmdShow)
{
if (*lpCmdLine=='Ho provato a vedere come lavora lpCmdLine:
#include<stdio.h>
#include<windows.h>
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
LPSTR lpCmdLine, int nCmdShow)
{
if (*lpCmdLine=='{parsed_message}') {
printf("NON CI SONO ARGOMENTI"
;
exit(0);
}
printf(lpCmdLine); // mi stampa tutto cio' che viene dopo l'eseguibile
printf(&lpCmdLine[1]);
return 0;
}
OUTPUT:
argomenti.exe arg1 arg2
arg1 arg2
rg1 arg2
argomenti.exe arg1 arg2 //gli spazi iniziali non li considera
arg1 arg2
rg1 arg2
come faccio a ricavare un solo argomento ? grazie
') {
printf("NON CI SONO ARGOMENTI"
;
exit(0);
}
printf(lpCmdLine); // mi stampa tutto cio' che viene dopo l'eseguibile
printf(&lpCmdLine[1]);
return 0;
}
OUTPUT:
argomenti.exe arg1 arg2
arg1 arg2
rg1 arg2
argomenti.exe arg1 arg2 //gli spazi iniziali non li considera
arg1 arg2
rg1 arg2
come faccio a ricavare un solo argomento ? grazie
aaa