October 18, 2002
This is a possibly dumb question, but does anyone know of a technique whereby one can determine whether an executable is launched from the command line or not. The desired behaviour I am after is outputting the help information to stdout if launched on the command-line, otherwise popping a dialog.

Let me tell you that I've tried querying the console characteristics but
that proved to be not wholly reliable, the same goes for getting the
standard handles (via GetStdHandle()).

Matthew


October 19, 2002
Try looking at argv[0], and see if there's a difference.

"Matthew Wilson" <dmd@synesis.com.au> wrote in message news:aoptfv$2v26$1@digitaldaemon.com...
> This is a possibly dumb question, but does anyone know of a technique whereby one can determine whether an executable is launched from the
command
> line or not. The desired behaviour I am after is outputting the help information to stdout if launched on the command-line, otherwise popping a dialog.
>
> Let me tell you that I've tried querying the console characteristics but
> that proved to be not wholly reliable, the same goes for getting the
> standard handles (via GetStdHandle()).
>
> Matthew
>
>