This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

change wallpaper periodly by cron?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]