Article View: borland.public.cppbuilder.nativeapi
Article #4014Re: Finding whether Console app has a window
From: Richard Casten
Date: Fri, 31 Mar 2006 19:35
Date: Fri, 31 Mar 2006 19:35
18 lines
1734 bytes
1734 bytes
"Remy Lebeau (TeamB)" wrote:
> It should if the process is not run in a console application, and the parent
> process is not redirecting the handles.
Well it doesn't. This is the code I used to test:
ret = 0;
if(GetStdHandle(STD_INPUT_HANDLE) == INVALID_HANDLE_VALUE)
ret = 1;
else if(GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE)
ret = 2;
else if(GetStdHandle(STD_ERROR_HANDLE) == INVALID_HANDLE_VALUE)
ret = 3;
The value of ret is 0. As a reminder from the initial message, this is a
console program but is being executed from a non-console program with the
CREATE_NO_WINDOW flag.
Technical Details
Message-ID:
<442D8486.850C15F5@aero.org>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44171EF9.DD8A51D0@aero.org> <44176d47@newsgroups.borland.com> <442C6CDC.AC3B927E@aero.org> <gpso22ph3nbmmsnr8fi92lfcmplpdpnoj2@4ax.com> <442D64E0.85D41157@aero.org> <442d7e31$3@newsgroups.borland.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: <442D8486.850C15F5@aero.org> Date: Fri, 31 Mar 2006 11:35:34 -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> <442D64E0.85D41157@aero.org> <442d7e31$3@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 130.221.27.185 X-Trace: newsgroups.borland.com 1143833628 130.221.27.185 (31 Mar 2006 11:33:48 -0700) Lines: 20 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail