Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: norge.freeshell.org: docbill owned process doing -bs Message-ID: <012e01c367fe$70c63d60$c900000a@docbill002> From: "Bill C. Riemers" To: , Cc: References: <20030820140025 DOT 325F DOT LUCIFER AT tsinghua DOT org DOT cn> <20030820082010 DOT GB12392 AT cygbert DOT vinschen DOT de> <20030821095027 DOT 2B3C DOT LUCIFER AT tsinghua DOT org DOT cn> <20030821031529 DOT GH11470 AT emcb DOT co DOT uk> <200308211331 DOT h7LDVqxf031372 AT beta DOT mvs DOT co DOT il> Subject: Re: change wallpaper periodly by cron? Date: Thu, 21 Aug 2003 12:07:27 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_011C_01C367DC.C9DAC690" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 ------=_NextPart_000_011C_01C367DC.C9DAC690 Content-Type: text/plain; charset="iso-8859-8-i" Content-Transfer-Encoding: 7bit There is a solution for programs which you don't compile. That is simply to reposition the console window off screen. i.e. Right click on the title bar of the window and select properties. Then go to layout. Unselect "Let system position window". Adjust the window so the position is off screen. Click "OK". Finally, select "Save properties for future windows with the same title" and click "OK". Now your window still opens, but it doesn't clutter the screen. If you want to avoid even having the icon, I find the successful approach for that is to invoke your program via rxvt. For example, for my Cygwin icon I use a short cut of with a target of: "d:\bin\rxvt.exe -e /bin/bash --login". You can use the -geometry option on your rxvt windows to hide those. Indeed a console window still opens, but it is off screen, and closes so quickly that most of the time I never see the icon on my task bar for it. For crontab jobs, I found the same type of trick works if you install the program as a service. i.e. cygrunsrv -I pcphone -a -w -p /usr/local/bin/pcphone -s QUIT -o -t manual Next under Windows Services, check the "allowed to interact with desktop button". Now whenever I run "/usr/local/bin/pcphone" either interactively, or from a crontab job, it simply starts calls "cygrunsrv -S pcphone" which in turn invokes: /usr/local/bin/pcphone -w Finally, the pcphone script when invoked as a service starts the real pcphone.exe via a nohup call to rxvt, sleeps for five seconds and then exits. So the "CONSOLE" window icon exists on my task bar for no more than five seconds. Once the "CONSOLE" window is closed, the "rxvt" window is also killed, however the children of "rxvt", "pcphone.exe" are not killed. So "pcphone.exe" is left running as an orphaned process. The reason for the five second delay is just to give rxvt enough time to invoke the "pcphone.exe" program. Bill ----- Original Message ----- From: "Ehud Karni" To: Cc: Sent: Thursday, August 21, 2003 9:31 AM Subject: Re: change wallpaper periodly by cron? > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Thu, 21 Aug 2003 04:15:29 +0100, Elfyn McBratney wrote: > > > > Lucifer wrote: > > > On Wed, 20 Aug 2003 10:20:10 +0200 > > > Corinna Vinschen wrote: > > > > > > CV> > > > CV> It's a limitation of service processes. You can only change it by setting > > > CV> the "Allow service to interact with desktop" property of the service. > > > CV> > > > > > > I enabled the "Allow service to interact with desktop" and it works now, > > > thank you. However, a DOS window titled as c:\cygwin\bin\cygrunsrv.exe > > > popped out. It's ugly. Can that be avoided? > > > > AFAIK, it cannot. It's the ugly side effect of interactive service(s) on > > Windows. > > Try to compile your program with -mwindows (without changing your > "main" function). I use this trick when I want a program without a > window (or console). If you run it from bash (or sh/csh) you wont > notice any change, but if you run it under command or cmd, it will > run without a (console) window. > > Ehud. > > > - -- > Ehud Karni Tel: +972-3-7966-561 /"\ > Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign > Insurance agencies (USA) voice mail and X Against HTML Mail > http://www.mvs.co.il FAX: 1-815-5509341 / \ > mailto:ehud AT unix DOT mvs DOT co DOT il Better Safe Than Sorry > -----BEGIN PGP SIGNATURE----- > Comment: use http://www.keyserver.net/ to get my key (and others) > > iD8DBQE/RMnHLFvTvpjqOY0RAvbKAJ9/NisvO2AiJpdQOdUBA4dVymz5SACeJka1 > qt/n45d0M2boTdaGlKIbso8= > =uhKZ > -----END PGP SIGNATURE----- > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Problem reports: http://cygwin.com/problems.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > ------=_NextPart_000_011C_01C367DC.C9DAC690 Content-Type: application/octet-stream; name="Cygwin.lnk" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Cygwin.lnk" TAAAAAEUAgAAAAAAwAAAAAAAAEbjAAAAIAAAAJBanv7zR8MBHBhpxKZfwwEQQt8GpfnCAQCOAgAA AAAAAQAAAAAAAAAAAAAAAAAAAJ8AFAAfUOBP0CDqOmkQotgIACswMJ0ZAC9EOlwAAAAAAAAAAAAA AAAAAAAAAAAAMAAxAAAAAADrLmq0EABiaW4AHgADAAQA777rLi6LCy+iCBQAAABiAGkAbgAAABIA QAAyAACOAgCDLmYuIAByeHZ0LmV4ZQAAKAADAAQA777rLh2sCy+NChQAAAByAHgAdgB0AC4AZQB4 AGUAAAAYAAAARAAAABwAAAABAAAAHAAAADMAAAAAAAAAQwAAABcAAAADAAAAVTc2PxAAAABDeWd3 aW4ARDpcYmluXHJ4dnQuZXhlAAAUAC0AZQAgAC8AYgBpAG4ALwBiAGEAcwBoACAALQAtAGwAbwBn AGkAbgANAEQAOgBcAGMAeQBnAHcAaQBuAC4AaQBjAG8AYAAAAAMAAKBYAAAAAAAAAGRvY2JpbGww MDIAAAAAAACMcXdZySt/QbRBXUXJH2PGoFK075i31xGjRQCgyaZDXIxxd1nJK39BtEFdRckfY8ag UrTvmLfXEaNFAKDJpkNcAAAAAA== ------=_NextPart_000_011C_01C367DC.C9DAC690 Content-Type: application/octet-stream; name="pcphone" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pcphone" #!/bin/bash=0A= PATH=3D"/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS/system32:/cygdri= ve/c/WINDOWS:/usr/X11R6/bin"=0A= export PATH=0A= PCPHONE=3D/cygdrive/e/PCPhone/PCPhone.exe=0A= if [ "SYSTEM" !=3D `whoami` ]=0A= then=0A= exec cygrunsrv --start pcphone=0A= fi=0A= if [ ! -x "$PCPHONE" ]=0A= then=0A= PCPHONE=3D/cygdrive/f/PCPhone.exe=0A= fi=0A= if [ "x$1" !=3D "x-w" ] ; then=0A= exec "$PCPHONE"=0A= else=0A= nohup /bin/rxvt -geometry 1x1+10000+10000 -title PcPhone -e "$PCPHONE" = & rxvtid=3D$!=0A= sleep 5=0A= kill $rxvtid=0A= exec cygrunsrv --stop pcphone 2>>/dev/null=0A= fi=0A= =0A= =0A= ------=_NextPart_000_011C_01C367DC.C9DAC690 Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ ------=_NextPart_000_011C_01C367DC.C9DAC690--