> > Under Win98, there are some subtle differences in the output of the program > below, when run from a DOS window vs. double-clicking the icon. > I don't know if this will work for NT-based OS, though.... > > {=====================} > program envtest; > uses Dos; > var > F:text; > i:LongInt; > begin > assign(F, 'envlist.txt'); > rewrite(F); > for i:=0 to EnvCount-1 do WriteLn(F, EnvStr(i)); > close(F); > end. > {=====================}
I'd try to search the win32 api, and find a way to find the parent of my process, either by a direct call, or enumerating all processes. And then check if it is cmd.exe or command.com or explorer.exe _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal