delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/20/02:13:17

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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-EYOU-ORIGINAL-IP: 202.106.86.73
X-EYOU-ENVELOPE-MAILFROM: lucifer AT tsinghua DOT org DOT cn
Date: Wed, 20 Aug 2003 14:12:52 +0800
From: Lucifer <lucifer AT tsinghua DOT org DOT cn>
To: cygwin AT cygwin DOT com
Subject: change wallpaper periodly by cron?
Message-Id: <20030820140025.325F.LUCIFER@tsinghua.org.cn>
MIME-Version: 1.0

I wrote a simple program to change my desktop wallpaper:

<CODE>

/* setwall.c */
#include <windows.h>

void usage()
{
        printf("Usage:\n\tsetwall <bmp_filename>\n\n");
}

int main(int argc, char **argv)
{
        int err;

        if (argc != 2) {
                usage();
                return 1;
        }

        if (SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, argv[1],
                                SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)) {
                printf("Wallpaper has been changed to: %s\n", argv[1]);
                return 0;
        } else {
                err = GetLastError();
                printf("Error: %lu\n", err);
                return err;
        }
}

</CODE>

It works well when I run it under cygwin console: the wallpaper changes
successfully.

However, when I put it in my crontab (I want to change my desktop
apperance periodly :p), the wallpaper doesn't change.  The log read:
"Error: 1459", which means "This operation requires an interactive
window station."

Is this a limitation of cron?  How can I resolve it?  Thanks in advance.

-- 
Lucifer <lucifer AT tsinghua DOT org DOT cn>



--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019