Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting a wallpaper #73

Open
kuitog opened this issue Aug 26, 2024 · 4 comments
Open

Setting a wallpaper #73

kuitog opened this issue Aug 26, 2024 · 4 comments

Comments

@kuitog
Copy link

kuitog commented Aug 26, 2024

Can't figure out how to set a desktop wallpaper with a solid color. (Or in alternative with an image)

The SetDesktopWallpaper function is not documented.

thanks

@kuitog
Copy link
Author

kuitog commented Aug 26, 2024

The file was deleted from mediafire @youngerwarrior

@FuPeiJiang
Copy link
Owner

FuPeiJiang commented Aug 26, 2024

@kuitog

IDesktopWallpaper:=ComObject("{c2cf3110-460e-4fc1-b9d0-8a1c0c9cc4bd}","{b92b56a9-8b55-4e14-9a89-0199bbb6f93b}")
loop 100 {
    ComCall(8,IDesktopWallpaper,"Uint",Random(0,0x00FFFFFF))
    Sleep 1000
}

this will set a random rgb color every 1000ms

IDesktopWallpaper:=ComObject("{c2cf3110-460e-4fc1-b9d0-8a1c0c9cc4bd}","{b92b56a9-8b55-4e14-9a89-0199bbb6f93b}")
ComCall(3,IDesktopWallpaper,"Ptr",0,"WStr","C:\path\to\wallpaper.jpg") ;monitorID=0 for all monitors

this is for setting a wallpaper(image) on all virtual desktops, and all monitors

#include %A_LineFile%\..\VD.ah2
VD.setWallpaperToDesktopNum("C:\path\to\wallpaper.jpg", 1)

this is for setting a wallpaper(image) to Desktop 1

@kuitog
Copy link
Author

kuitog commented Aug 28, 2024

@FuPeiJiang Hi!
many thanks for the reply!
Example 1 is perfect, but I can't figure out how to assign it only to desktop 2

IDesktopWallpaper:=ComObject("{c2cf3110-460e-4fc1-b9d0-8a1c0c9cc4bd}","{b92b56a9-8b55-4e14-9a89-0199bbb6f93b}") loop 100 { ComCall(8,IDesktopWallpaper,"Uint",Random(0,0x00FFFFFF)) Sleep 1000 }

@FuPeiJiang
Copy link
Owner

@kuitog
I don't even know how to do this manually in windows: how to set a different solid color for each virtual desktop
a workaround would be to use a .png (that is a solid color) for each virtual desktop

if you want that, I'll try to write a random solid color .png generator in ahk ?
it's a very good way to understand the format, imo

@github-staff github-staff deleted a comment from mayank785 Oct 23, 2024
@github-staff github-staff deleted a comment from mayank785 Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@FuPeiJiang @kuitog and others