|
-
August 6th, 2001, 05:26 AM
#1
how to code to change wallpaper?
how to code to change wallpaper?
-
August 6th, 2001, 06:48 AM
#2
Re: how to code to change wallpaper?
http://www.codeguru.com/cgi-bin/bbs/...age=0&Limit=25
Please - rate answer if it helped you
It gives me inspiration when I see myself in the top list =)
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
[email protected] | ICQ:57404554 | http://soukhov.com
Member of Russian Software Developers Network http://rsdn.ru
-
August 6th, 2001, 07:41 AM
#3
Re: how to code to change wallpaper?
HI, this is what i did:
#define CAPS_WALLPAPER_BESTFIT 0
#define CAPS_WALLPAPER_STRETCH 1
#define CAPS_WALLPAPER_TILE 2
void CMainFrame::SetWallPaper ( int Style )
{
// Get window path and save image to the directory
char* Filepath = _T("C:\\Winnt\\ACD Wallpaper.bmp");
// Prepare the entry value
BYTE TileFlag[2] = {'0',0};
BYTE StyleFlag[2] = {'0',0};
if ( Style == CAPS_WALLPAPER_STRETCH )
StyleFlag[0] = '2';
if ( Style == CAPS_WALLPAPER_TILE )
TileFlag[0] = '1';
// Set the Wall Paper now
HKEY hKey;
if ( RegOpenKeyEx (HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_ALL_ACCESS, &hKey)
== ERROR_SUCCESS )
{
LPCSTR EntryPath = "Wallpaper";
LPCSTR EntryTile = "TileWallpaper";
LPCSTR EntryStyle = "WallpaperStyle";
RegSetValueEx (hKey, EntryTile, 0, REG_SZ, TileFlag, 1);
RegSetValueEx (hKey, EntryStyle, 0, REG_SZ, StyleFlag, 1);
SystemParametersInfo (SPI_SETDESKWALLPAPER, 0, Filepath, SPIF_UPDATEINIFILE|SPIF_SENDWININICHANGE);
RegFlushKey (hKey);
RegCloseKey (hKey);
}
}
void CMainFrame::OnSetWallPaperBestFit()
{
SetWallPaper (CAPS_WALLPAPER_BESTFIT);
}
void CMainFrame::OnSetWallPaperStretch()
{
SetWallPaper (CAPS_WALLPAPER_STRETCH);
}
void CMainFrame::OnSetWallPaperTile()
{
SetWallPaper (CAPS_WALLPAPER_TILE);
}
-
August 6th, 2001, 08:23 AM
#4
Re: how to code to change wallpaper?
http://codeguru.earthweb.com/cgi-bin...age=0&Limit=25
Chen Weiye
------------------------------------------------------------------------------
When pursuing your dream, don't forget to enjoy your life...
------------------------------------------------------------------------------
Chen Weiye
-----------------------------------------------------------------------------
When pursuing your dream, don't forget to enjoy your life
-----------------------------------------------------------------------------
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
|