Desktop Background.
BlitzMax Forums/BlitzMax Programming/Desktop Background.
| ||
Just wondering if anyone has any example code of how to change the current desktop background with blitz, max or 3d I have both. Not done much code for years so the simpler the better. thanks in advance. |
| ||
From Google I noticed the Windows API command to do so is 'SystemParametersInfo'. So I searched all forums for this name. http://blitzbasic.com/Community/posts.php?topic=90016 http://blitzbasic.com/Community/posts.php?topic=61383 http://blitzbasic.com/Community/posts.php?topic=80128 EDIT: Never forget to query the user for such action. Last edited 2011 |
| ||
That helped and gave me exactly what I wanted, thanks m8. |
| ||
If you find out how to do it on Mac, please report back! |
| ||
OSX maybe with some applescript?: tell application "Finder" set desktop picture to POSIX file "/your/filename.jpg" end tell You can run it from the command line using osascript, or from Python using something like import subprocess SCRIPT = """/usr/bin/osascript<<END tell application "Finder" set desktop picture to POSIX file "%s" end tell END""" def set_desktop_background(filename): subprocess.Popen(SCRIPT%filename, shell=True) |
| ||
Very interesting. Can you call such a script from in BMax though? Like via a batch file? |
| ||
OK I'm a little close. Need to turn this into a function that can e imported into BMax: http://stackoverflow.com/questions/3220416/how-to-get-and-set-the-wallpaper-in-objective-c-on-mac-osx |