|
-
Nov 9th, 2006, 10:39 AM
#1
Thread Starter
Member
Need Code: Upon open, change desktop background
Hey again all, I been trying to look for this and haven't been successful. Can anyone help me with this code? When you open up the application, the background of your desktop will change. I will provide the .jpg or .gif or .jpeg or .tif file. Thanks ahead of time.
-
Nov 9th, 2006, 05:38 PM
#2
Re: Need Code: Upon open, change desktop background
I don't know but I would guess that the location of the current desktop wallpaper is stored in the registry. If that's the case then you need to find the key and value it stored under and then what you want to do is just a matter of opening the key and setting the value.
-
Nov 9th, 2006, 06:34 PM
#3
Re: Need Code: Upon open, change desktop background
Depending on your OS it will be in
(XP)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme\Wallpaper
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 10th, 2006, 12:31 AM
#4
Thread Starter
Member
Re: Need Code: Upon open, change desktop background
-
Nov 10th, 2006, 09:06 AM
#5
Re: Need Code: Upon open, change desktop background
Sorry if I am wrong, but if you want to change the wallpaper, yu can use SystemParametersInfo API at Form's load event.
Code:
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
public static extern void SystemParametersInfoA (int uAction, int uParam, string lpvParam, int fuWinIni);
private const int SPI_SETDESKWALLPAPER = 20;
private const int SPIF_UPDATEINIFILE = 0x0001;
private void Form1_Load(object sender, System.EventArgs e)
{
SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, path of image, SPIF_UPDATEINIFILE);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|