Std::unique_ptr Bmp(new Graphics::TBitmap) Std::unique_ptr CreateWallpaperBitmap_WallpaperCoords() Rect.Bottom += PrimaryMonitor->Top - Screen->DesktopTop Rect.Right += PrimaryMonitor->Left - Screen->DesktopLeft Rect.Top += PrimaryMonitor->Top - Screen->DesktopTop Rect.Left += PrimaryMonitor->Left - Screen->DesktopLeft TRect Rect(Monitor->Left, Monitor->Top, Monitor->Left + Monitor->Width, Monitor->Top + Monitor->Height) Get the rectangle in desktop coordinates I draw the contents of each monitor to that bitmap in its appropriate position (the program is written in C++ using VCL, but the principle remains the same in other programming environments): TRect GetMonitorRect_WallpaperCoords(int MonitorNum)įorms::TMonitor *PrimaryMonitor = Screen->Monitors įorms::TMonitor *Monitor = Screen->Monitors How it works: I create a bitmap that conceptually covers the whole desktop space, as the user sees it. I understand that, I wrote a little program using that knowledge, and it works beautifully in Windows 7. The core concepts is that Windows places the top-left corner of the provided bitmap at the top-left corner of the primary monitor, and wraps around to fill any desktop space to the left and/or above that. Raymond Chen has an article "How do I put a different wallpaper on each monitor?" ( ), also quoted in Monitors position on Windows wallpaper. There are a number of questions and answers about setting wallpapers programmatically on multi-monitor setups in Windows, but I'm asking specifically for Windows 10 (and maybe Windows 8) because it seems to work differently from all the explanations I found.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |