🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4010

Re: Finding whether Console app has a window

#4010
From: Richard Casten
Date: Fri, 31 Mar 2006 17:20
23 lines
1673 bytes
Bob Gonder wrote:

> Richard Casten wrote:
>
> >"Remy Lebeau (TeamB)" wrote:
> >
> >> Use GetStdHandle() or CreateFile() to retreive the process's console handles
> >> and then check if they are assigned or not.
> >
> >How do I determine if they are assigned or not?
>
> Return value should be INVALID_HANDLE_VALUE
>
> Note that the stdin/stdout might be redirected, with no visible
> console, and the above would return valid handles.

GetStdHandle does not return INVALID_HANDLE_VALUE for any of the standard handles
in this situation..

> Depending on your needs, you might see if GetConsoleTitle() returns an
> error if no console is visible.

GetConsoleTitle does not return in this situation.
Technical Details
Message-ID: <442D64E0.85D41157@aero.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <44171EF9.DD8A51D0@aero.org> <44176d47@newsgroups.borland.com> <442C6CDC.AC3B927E@aero.org> <gpso22ph3nbmmsnr8fi92lfcmplpdpnoj2@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8446b6f28f0db0be
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Message-ID: <442D64E0.85D41157@aero.org>
Date: Fri, 31 Mar 2006 09:20:32 -0800
From: Richard Casten <richard.casten@aero.org>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Finding whether Console app has a window
References: <44171EF9.DD8A51D0@aero.org> <44176d47@newsgroups.borland.com> <442C6CDC.AC3B927E@aero.org> <gpso22ph3nbmmsnr8fi92lfcmplpdpnoj2@4ax.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 130.221.27.185
X-Trace: newsgroups.borland.com 1143825526 130.221.27.185 (31 Mar 2006 09:18:46 -0700)
Lines: 25
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail