change_wallpaper
This is an old revision of the document!
Change Wallpaper
# Changes the wallpaper to a randomly selected file. use strict; use warnings; use Win32::API; use constant SPI_SETDESKWALLPAPER => 20; use constant SPIF_UPDATEANDSENDINI => 3; use constant NULL => 0; my @files = <"C:/11000 x 7703 (Raw)/Wallpaper/*">; my @file = $files[int rand($#files)]; my $syspinf = Win32::API->new('user32','SystemParametersInfo', 'IIPI', 'I') or die "Could not import function.\n"; $syspinf->Call(SPI_SETDESKWALLPAPER, NULL, @file, SPIF_UPDATEANDSENDINI);
change_wallpaper.1259102921.txt.gz · Last modified: 2017/01/01 19:48 (external edit)