[fpc-pascal] Re: Can a program find out how it was started?
Jeff Pohlmeyer
yetanothergeek at gmail.com
Tue Aug 2 18:46:47 CEST 2005
> Is it possible for a program to tell whether it was started
> from the command line or started by double-clicking on
> the application icon?
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.
{=====================}
More information about the fpc-pascal
mailing list