public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Lucifer <lucifer@tsinghua.org.cn>
To: cygwin@cygwin.com
Subject: change wallpaper periodly by cron?
Date: Wed, 20 Aug 2003 08:02:00 -0000	[thread overview]
Message-ID: <20030820140025.325F.LUCIFER@tsinghua.org.cn> (raw)

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@tsinghua.org.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/

             reply	other threads:[~2003-08-20  6:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-20  8:02 Lucifer [this message]
2003-08-20 12:07 ` Corinna Vinschen
2003-08-21  3:34   ` Re[2]: " Lucifer
2003-08-21  3:52     ` Elfyn McBratney
2003-08-21  5:00       ` Christopher Faylor
2003-08-21 14:30       ` Ehud Karni
2003-08-21 16:43         ` Bill C. Riemers
2003-08-21 22:35           ` Igor Pechtchanski

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=20030820140025.325F.LUCIFER@tsinghua.org.cn \
    --to=lucifer@tsinghua.org.cn \
    --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).