Re: How to determine at runtime where the application is launched from



Norm Dresner wrote:
> "hereafter" <hereafter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:BF905576-638F-461A-94F1-76759BBBFAC8@xxxxxxxxxxxxxxxx
>> I notice some .exe program under \WIndows folder
>> when i click on them, the display a dialog shows the version info
>> and when i type their names in a command prompt, they display the
>> credit within the command prompt
>>
>> Is there a way to determine where the application is launched? from
>> console
>> or
>> double click LButton?
>
> 1. An icon on the desktop can provide a program with optional
> command-line information and switches to alter it's behavior.

Yes, an icon could. But if you just launch it from explorer by
double-clicking on the exe file?

> 2. A trick that's common in Unix is to have a program do several
> different things depending on the name by which it's executed (mv --
> cp for example). Since the program's execution name is argv[0],
> it's readily available.

Yes, but if there were two executables with different names, they
wouldn't be the same program, would they?

V


.