desktop-wallpaper

Change wallpaper programmatically using c++ and windows api

我的未来我决定 提交于 2021-02-05 20:37:50
问题 I've been trying to write an application, using Qt and mingw32, to download images and set them as the background Wallpaper. I have read several articles online about how to do this, in VB and C#, and to some extent how to do it in c++. I am currently calling the SystemParametersInfo with what seems to be all the correct arguments (no compiler errors) and it fails. No great crash of cymbals, just a 0 returned. GetLastError() returns an equally enlightening 0 . Below is the code I am using (In

Change wallpaper programmatically using c++ and windows api

感情迁移 提交于 2021-02-05 20:35:26
问题 I've been trying to write an application, using Qt and mingw32, to download images and set them as the background Wallpaper. I have read several articles online about how to do this, in VB and C#, and to some extent how to do it in c++. I am currently calling the SystemParametersInfo with what seems to be all the correct arguments (no compiler errors) and it fails. No great crash of cymbals, just a 0 returned. GetLastError() returns an equally enlightening 0 . Below is the code I am using (In

Draw on Windows 10 wallpaper in C++

家住魔仙堡 提交于 2019-12-19 08:54:25
问题 Is there a way to get an handle to Windows's wallpaper (behind icons) in C++ in order to draw on it? That would allow to make an active desktop (discontinued after Windows XP) equivalent, a Wallpaper Engine equivalent, or any other similar tool. (Temperature and resources usage monitoring on the wallpaper in my case). Note: the handle returned by GetDesktopWindow() returns the window at desktop icons level, not behind it. Solutions from similar questions aren't working for me. Specifically i

How does one detect when the wallpaper has changed (Windows XP or greater)?

一曲冷凌霜 提交于 2019-12-10 17:33:53
问题 I have figured out how to change the desktop wallpaper (there are dozens of examples on the Internet.) One thing that still eludes me: how do I detect when the wallpaper has changed? (Say via the Display control panel or another program changing it.) 回答1: Add a message handler for WM_SETTINGCHANGE, SystemEvents.UserPreferenceChanged in .NET. Check if the wallpaper is still the same. 回答2: Here is an example in C# to retrieve the wallpaper. All you would need to add is some additional code to

How to change wallpaper using batch

◇◆丶佛笑我妖孽 提交于 2019-12-10 10:28:47
问题 I need to make a batch file that changes the wallpaper to a picture that is in the same location as the bat file I currently have this code: reg add "HKCU\Control Panel\Desktop" /v Wallpaper /f /t REG_SZ /d c:\images\wallpaper.bmp the problem with this is that it the pictures need to be in the folder c:\images\ and I need it to be in the same place as the bat file. does any one know how I could do it. 回答1: You can use %~dp0wallpaper.bmp %~dp0 returns the full path of the batch file that is

SystemParametersInfo sets wallpaper completly black (using SPI_SETDESKWALLPAPER)

可紊 提交于 2019-12-03 17:53:42
问题 I try to change my desktop wallpaper. It works just fine when I use it like this: SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "C:\\1.jpg", SPIF_SENDCHANGE); But when I use it like this, the desktop wallpaper is set completly black: std::string s = "C:\\1.jpg"; SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, &s, SPIF_SENDCHANGE); I tried to get some more info via using GetLastError() , but the return value is just 0. I also tried to use .png-files, but this doesn't change anything. Any ideas

Draw on Windows 10 wallpaper in C++

五迷三道 提交于 2019-12-01 07:04:57
Is there a way to get an handle to Windows's wallpaper (behind icons) in C++ in order to draw on it? That would allow to make an active desktop (discontinued after Windows XP) equivalent, a Wallpaper Engine equivalent, or any other similar tool. (Temperature and resources usage monitoring on the wallpaper in my case). Note: the handle returned by GetDesktopWindow() returns the window at desktop icons level, not behind it. Solutions from similar questions aren't working for me. Specifically i tried VLC media player's wallpaper mode code. Key code is: hwnd = FindWindow( _T("Progman"), NULL ); if

different wallpaper for each screen for multi-monitor setups in Windows

拜拜、爱过 提交于 2019-12-01 00:28:56
I'm using: ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, "picturefile", 0) To change the wallpaper. But I'm wondering if there's any simple way to put different wallpapers on each screen. This feature isn't standard in windows though, but there are external applications like ultramon that do this. Anyone know how that works? The way I thought it might work if I join the two images together into one and then make that the wallpaper, but then I still need a way to span one image accross both screens. Also, how could I grab some info about the monitor setup, the resolution

different wallpaper for each screen for multi-monitor setups in Windows

♀尐吖头ヾ 提交于 2019-11-30 20:00:21
问题 I'm using: ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, "picturefile", 0) To change the wallpaper. But I'm wondering if there's any simple way to put different wallpapers on each screen. This feature isn't standard in windows though, but there are external applications like ultramon that do this. Anyone know how that works? The way I thought it might work if I join the two images together into one and then make that the wallpaper, but then I still need a way to span one

Changing wallpaper on Linux programmatically

橙三吉。 提交于 2019-11-29 10:29:29
问题 How would I change the wallpaper on a Linux desktop (using GNOME) within a C/C++ program? Is there a system API to do it? 回答1: Though the question was gnome-specific, there's also a way to deal with the wallpaper that is not depepndant on the higher layer toolkits. You should be able to deal with the root window (which the wallpaper is, in fact) by studying the source of xsetroot.c, the most interesting part of which I copypaste here: static void SetBackgroundToBitmap(Pixmap bitmap, unsigned