First of all, the function has 3 return values:
SE_ERR_OOM - System out of memory (WinXP only IIRC)
SE_ERR_FNF - File not Found
SE_ERR_NOASSOC - The file type has no associated exe
So, you could do something like this
int rValue=FindExecutable(argv[1], NULL, rgvalue);
if(rValue==SE_ERR_OOM)
printf("System out of memory/resources");
else if(rValue==SE_ERR_FNF)
printf("File not found");
else if(rValue==SE_ERR_NOASSOC)
printf("There's no associated executable with the given file type");
else
printf("%s", rgvalue);
Now, theres an error in the buffer:
char rgvalue[100];
Should actually be
char rgvalue[MAX_PATH];
You need o have that in account when working with paths in windows, since there might be a path longer than 100 (whjat you specified), but its never longer than MAX_PATH (a compiler global define)
Not that you probably dont know, but this function is meant to search for the executable associated with a filename, for example *.doc->word,*.txt->notepad and so on, but you knew that already dontcha?
Anyway, I hope that helps, good luck
cheers