From: Oleksandr Gavenko <gavenkoa@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Hiding console when running Cygwin utility from Task Scheduler.
Date: Thu, 03 Aug 2017 11:43:00 -0000 [thread overview]
Message-ID: <861sosx4g9.fsf@gavenkoa.example.com> (raw)
In-Reply-To: <f5574d4f-6edd-d179-f4fc-5fff611eaa70@SystematicSw.ab.ca>
On 2017-08-02, Brian Inglis wrote:
> I believe that conhost, mintty, ptys, cron, and Cygwin program startup open
> handles for stdin, stdout, stderr to talk on, as those are assumed to be
> available by most programs, rather than closing anything, which could terminate
> program execution.
>
Small correction about `conhost`:
https://blogs.technet.microsoft.com/askperf/2009/10/05/windows-7-windows-server-2008-r2-console-host/
https://blogs.msdn.microsoft.com/reiley/2012/09/13/windows-8-and-conhost-exe/
It is native Windows app. I believe that it is responsible to drawing native
console and I want to hide it.
> Cygwin run allows you to run a Windows GUI program with a hidden console window.
>
I think situation a bit different. run.exe is able to "hide" console of
console app. Cygwin compiles each app as console as GUI app have no access to
stdin/stdout and can't attach to any console, as state run(1):
Windows programs are either GUI programs or console programs. When
started console programs will either attach to an existing console or
create a new one. GUI programs can never attach to an exiting console.
There is no way to attach to an existing console but hide it if started
as GUI program.
>> My goal to avoid any splashes on screen and possible keyboard focus stealing
>> from sudden task execution.
>
> I never see any windows or conhost processes running Cygwin Scheduled Tasks with
> the previous suggestions and these settings:
>
>>> You may also have to set the (o) Run whether user is logged on or not
>>> radio button, [X] Do not store password..., and [X] Run with highest
>>> privileges check boxes.
>
> where the first may be most significant in this case;
Thanks! That is. When I change from:
[x] run only when user logged in
to:
[x] run whether user is logged on or not
I don't see that temporary console window.
I was going to check what happen with Cygwin app launched from nssm and see
comment:
2017-04-26: Users of Windows 10 Creators Update should use prelease build
2.2.4-101 to avoid an issue with services failing to start. If for some
reason you cannot use that build you can also set AppNoConsole=1 in the
registry, noting that applications which expect a console window may behave
unexpectedly.
https://nssm.cc/download
So Microsoft recently changed something in its console related API...
--
http://defun.work/
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2017-08-03 11:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-02 16:06 Oleksandr Gavenko
2017-08-02 19:21 ` Brian Inglis
2017-08-02 23:41 ` Oleksandr Gavenko
2017-08-03 5:21 ` Brian Inglis
2017-08-03 11:43 ` Oleksandr Gavenko [this message]
2017-08-03 13:05 ` cyg Simple
2017-08-03 14:09 ` Oleksandr Gavenko
2017-08-07 17:05 ` Andrey Repin
2017-08-07 17:36 ` Oleksandr Gavenko
2017-08-08 0:05 ` Andrey Repin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=861sosx4g9.fsf@gavenkoa.example.com \
--to=gavenkoa@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).