WildByDesign Posted Wednesday at 10:48 AM Posted Wednesday at 10:48 AM (edited) This example script is a desktop live wallpaper program. It is a combination of MediaPlayerElement - WinRT Xaml Island by @MattyD and Move window behind desktop icons by @Parsix. It basically creates a GUI layer under the desktop icons but above the wallpaper (eg. in a WorkerW window within Program Manager). Features: Configuration file (LiveWallpaper.ini) Plays .mp4 videos and likely many more formats Light on CPU (uses GPU for video processing) Play/Pause video by double-click (can change to single-click in config) Option to Loop video Transparency level (to blend video with your real wallpaper) Important Note: To run this, the XAML Islands require the following value in the AutoIt binary manifest: <maxversiontested Id="10.0.18362.1"/> There are two options. The first is ExternalManifest.au3 which essentially drops an external manifest file that includes that value beside your existing AutoIt binaries (eg. AutoIt3.exe.manifest and AutoIt3_x64.exe.manifest). This will allow you to run LiveWallpaper.au3 in your file manager by double-clicking on the script. However, the downside to this method is that it will not work through VSCode or SciTE and therefore you cannot get any ConsoleWrite info if you need it. The second option is Update Manifest.au3 which patches your actual AutoIt binary to include the required maxversiontested value. It makes a backup of your original AutoIt binary and you have to copy the modified one over your original. This is the better method if you want to extend the LiveWallpaper code, run through VSCode or SciTE and add/get console output. If you intend to compile as a binary, that compiled binary needs the maxversiontested value. You need to set the "win10" compatibility flag with AutoIt3Wrapper (already at top of LiveWallpaper.au3) and you need to be using the absolute latest beta version of AutoIt3Wrapper.au3 because the maxversiontested value has been added to it. To Do (possibilities): Option for volume level Option for playback rate Hotkeys Start on trigger (when logging in, when clicking Start menu, etc.) etc. Live Wallpaper Videos: I have only tested a bunch of .mp4 videos with this, including 4K. I have included bloom.mp4 which is rather low quality, but I wanted something that people can test with and it's small enough for attachment space. But there are many, many live wallpaper web sites out there. Some videos look good on loop (like a fireplace), while others don't. I'm sure lots of other video formats work. But I have only tested .mp4 and that is the format that most video wallpaper sites use. LiveWallpaper.7z Edited Thursday at 12:05 AM by WildByDesign Updated to support 3.3.16.1 argumentum, MattyD, SOLVE-SMART and 1 other 4
WildByDesign Posted Wednesday at 10:52 AM Author Posted Wednesday at 10:52 AM I wanted to add that this would not have been possible without help from @pixelsearch, @UEZ, @Nine, @argumentum and of course the two already tagged in the first post. And likely many more that I have learned from in the forum. The amount of helpful guidance here is incredible. So while I am using this functionality for a current project, I wanted to share the exact same functionality here to give back in case anyone wants or needs this as a base for something more.
SOLVE-SMART Posted Wednesday at 07:48 PM Posted Wednesday at 07:48 PM Hi and thank you a lot @WildByDesign for that great work 👌 . I started to have a look at your code and realized it's probably made for the current AutoIt version v3.3.18.0 and not for v3.3.16.1, am I right? I mean you already mentioned the absolute latest beta version of AutoIt3Wrapper.au3, but there are more incompatibilities between the AutoIt versions itself. _IsPressed() has changed from two to three args $CP_UTF8 is unknown in v3.3.16.1 If you simply say: "just update to the new AutoIt version", I am totally fine. But in case there shouldn't be such incompatibilities, this would be easily fixable I guess. Best regards Sven WildByDesign 1 ==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet, 🔗 autoit-webdriver-boilerplate Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
WildByDesign Posted Wednesday at 08:14 PM Author Posted Wednesday at 08:14 PM (edited) 26 minutes ago, SOLVE-SMART said: I started to have a look at your code and realized it's probably made for the current AutoIt version v3.3.18.0 and not for v3.3.16.1, am I right? I mean you already mentioned the absolute latest beta version of AutoIt3Wrapper.au3, but there are more incompatibilities between the AutoIt versions itself. _IsPressed() has changed from two to three args $CP_UTF8 is unknown in v3.3.16.1 You are 100% right, Sven. You made me realize that I haven’t paid any attention at all regarding compatibility between AutoIt versions. I really appreciate that you pointed that out because I never thought about it. I suppose the easiest way for me to test would be to run several versions side by side. I imagine I would need to have the previous version(s) as portable maybe and run by command lines. I’ll have to think about how to set this up. In the meantime, I will update the script later tonight and I will have to pay closer attention to this going forward. Thank you so much. Edited Wednesday at 08:14 PM by WildByDesign SOLVE-SMART 1
argumentum Posted Wednesday at 11:04 PM Posted Wednesday at 11:04 PM Local Const $CP_UTF8 = 65001 should solve that. For _IsPressed(), people can press F1 to find out what UDF is that in. Easy peasy lemon squeezy SOLVE-SMART 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
WildByDesign Posted Wednesday at 11:26 PM Author Posted Wednesday at 11:26 PM 18 minutes ago, argumentum said: Local Const $CP_UTF8 = 65001 should solve that. Thanks. I tried this and it wont seem to work. Since it is already called in APIConvConstants.au3 as: Global Const $CP_UTF8 = 65001 Even if I try to tell it to only do it for a specific AutoIt version, it fails for me on v3.3.18 since it is already declared.
argumentum Posted Wednesday at 11:31 PM Posted Wednesday at 11:31 PM 26 minutes ago, argumentum said: Local Const $CP_UTF8 = 65001 should solve that. 4 minutes ago, WildByDesign said: Thanks. I tried this and it wont seem to work. Since it is already called in APIConvConstants.au3 as: Global Const $CP_UTF8 = 65001 Even if I try to tell it to only do it for a specific AutoIt version, it fails for me on v3.3.18 since it is already declared. Local. Inside the function. SOLVE-SMART and WildByDesign 1 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
WildByDesign Posted Wednesday at 11:41 PM Author Posted Wednesday at 11:41 PM 8 minutes ago, argumentum said: Local. Inside the function. Bingo! That did it. Thank you for that trick. I had a similar issue like that before with a Global Const and I didn't realize that I could override it with a Local Const within a function. I'm learning something everyday. argumentum 1
WildByDesign Posted Thursday at 12:08 AM Author Posted Thursday at 12:08 AM @SOLVE-SMART I updated the script in the first post to support 3.3.16.1. Thanks for letting me know about that. Now I've got a portable setup of 3.3.16.1 so that I can test any of my scripts on as well. argumentum 1
MattyD Posted Thursday at 01:34 AM Posted Thursday at 01:34 AM Just be aware that the function which actually uses $CP_UTF8 (_WinAPI_MultiByteToWideChar) has also changed since the update.... The old version of this doesn't work as the strings in the metadata files aren't null-terminated. Not that we're necessarily calling this func in this project - but just FYI! SOLVE-SMART and WildByDesign 2
SOLVE-SMART Posted Thursday at 04:33 AM Posted Thursday at 04:33 AM Hi folks, hi @WildByDesign 👋 , I really appreciate your effort regarding the compatibility 😊 . But let me also mention that you shouldn't try to respect to much AutoIt versions in the backwards compatibility direction. People should (as I obviously too), update software from time to time. In my case I don't use AutoIt regularly anymore and I saw the changelog of the new AutoIt version (when 3.3.18.0 was released) and I didn't want to adjust several of my older projects to apply with these changes. Anyway, this is my problem not yours. Of course it would be fine if there is a backwards compatibility, but not down to 3.3.12.* or so (in my opinion). 4 hours ago, WildByDesign said: I updated the script in the first post to support 3.3.16.1. Thanks for letting me know about that. I try to give you feedback today or tomorrow 🤝 . Best regards Sven ==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet, 🔗 autoit-webdriver-boilerplate Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
argumentum Posted Thursday at 10:02 AM Posted Thursday at 10:02 AM 8 hours ago, MattyD said: the function which actually uses $CP_UTF8 (_WinAPI_MultiByteToWideChar) has also changed since the update.... 5 hours ago, SOLVE-SMART said: saw the changelog of the new AutoIt version (when 3.3.18.0 was released) and I didn't want to adjust several of my older projects to apply with these changes. On that point I should confess that I haven't updated my everyday PC to the latest version and that have projects still in v3.3.14.2 on other PCs ( quite shamelessly too ). If I had to start a new project, it'd be advisable to use the latest. In this case, that is so involved with the OS, is more important than just a SQLite script ( for example ), were the GUI is just to have a working interface. So yes, I too am of the opinion that you should focus the project on the updated engine/stub and it's UDFs. And as you've discovered yourself, a portable instance of other versions are quite simple to have. ( suck on that python !. ppl had to invent "Docker" to solve your issues ! ) SOLVE-SMART and WildByDesign 2 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now