AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Display a Random Picture

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Laughing Man



Joined: 29 Apr 2005
Posts: 84
Location: Maryland

PostPosted: Tue May 23, 2006 2:19 am    Post subject: Display a Random Picture Reply with quote

I've been browsing thru the search and the commands help on the main site and I've been wondering. What commands would I need to look at to display a random picture on the desktop every 5 minutes from a directory?
_________________
"I thought what I'd do was I'd pretend I was one of those deaf-mutes" ~ Laughing Man - GITS:SAC
Back to top
View user's profile Send private message Yahoo Messenger
BoBo
Guest





PostPosted: Tue May 23, 2006 7:27 am    Post subject: Reply with quote

Quote:
I've been browsing thru the search and the commands help on the main site and I've been wondering
Hu? Shocked I guess to identify the Random command will be the toughest challenge!
Back to top
Zippo()
Guest





PostPosted: Tue May 23, 2006 7:29 am    Post subject: Reply with quote

DllCall:

Quote:
; Example: Change the desktop wallpaper to the specified bitmap (.bmp) file.

DllCall("SystemParametersInfo", UInt, 0x14, UInt, 0, Str, A_WinDir . "\winnt.bmp", UInt, 2)


... and Sleep or SetTimer

Smile
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue May 23, 2006 9:32 am    Post subject: Reply with quote

Why a double post?

Change wallpaper from script!
http://www.autohotkey.com/forum/viewtopic.php?t=167&highlight=random+image
Automatic Wallpaper Changer [AHK Script, requires IrfanView]
http://www.autohotkey.com/forum/viewtopic.php?t=7285&highlight=random+image
Random screensaver
http://www.autohotkey.com/forum/viewtopic.php?t=7566&highlight=random

The last link is for the clever algorithm of choosing a random file out of a list without having to know in advance the number of files, nor having to read the whole list of files.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Laughing Man



Joined: 29 Apr 2005
Posts: 84
Location: Maryland

PostPosted: Tue May 23, 2006 4:03 pm    Post subject: Reply with quote

I'm not changing wallpaper though. I was just wondering if there was a way to display a picture on the desktop..kinda like how some widgets do. Though I don't think AHK has any built in way to draw a box to display the picture in?
_________________
"I thought what I'd do was I'd pretend I was one of those deaf-mutes" ~ Laughing Man - GITS:SAC
Back to top
View user's profile Send private message Yahoo Messenger
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue May 23, 2006 4:32 pm    Post subject: Reply with quote

You have to be more precise on the concept of "display a picture on the desktop". In a window? As part of the wallpaper (Active Desktop?)?
If you just want a little window, you have to create a GUI.
Basically something like:
Gui Add, Picture, x20 y20, %imagePath%
Gui Show

I let you assign randomly imagePath, using the algorithm of the last link...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group