<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>you could do either of the following:</DIV>
<DIV> </DIV>
<DIV>1. replace the wallpaper file itself without touching the registry , by using commands from os module.</DIV>
<DIV>2. What i gather is that as a non-adminstrative user you dont have permission to change the registry. So u could use the LogonUser and ImpersonateLoggedonUser functions from win32security module to impersonate as the administrator before editing the registry.</DIV>
<DIV> </DIV>
<DIV>tell me if it helps.</DIV>
<DIV> </DIV>
<DIV>shitiz</DIV>
<DIV><BR><BR><B><I>Chris Barnhart <mlist-python@dideas.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hi,<BR><BR>I'm attempting to write a python (2.3.3) program that will update the <BR>wallpaper under Windows 2000. I found an example delphi program : <BR>(http://www.latiumsoftware.com/en/delphi/00020.php) which suggest that I <BR>need to change a registry variable, and then execute a system parameters <BR>changed statement.<BR><BR>The following program attempts to change the desktop wallpaper by changing <BR>a key in the HKEY_CURRENT_USER. This fails due to access denied? I'm <BR>using methods from _winreg.<BR><BR>What weird, is that by using OpenKey I've been able to create new registry <BR>sub folders, and then using SetValue, change the value of the "default" key.<BR><BR>I've also looked modifying the registry from WMI, and also looked at using <BR>windll - but obsolete.<BR><BR>Any ideas?<BR><BR>Thank you,<BR>Chris<BR><BR>--------------<BR><BR><BR>import _winreg as
wreg<BR><BR>key = wreg.OpenKey(wreg.HKEY_CURRENT_USER, "Control Panel\\Desktop")<BR>v = wreg.QueryValueEx(key,"WallPaper")<BR>print "Key value is : ", v<BR>wreg.SetValueEx(key, "WallPaper", 0, wreg.REG_SZ, v[0])<BR><BR>C:\src\python>python r3.py<BR>Key value is : (u'C:\\WINNT\\Mozilla Wallpaper.bmp', 1)<BR>Traceback (most recent call last):<BR>File "r3.py", line 6, in ?<BR>wreg.SetValueEx(key, "WallPaper", 0, wreg.REG_SZ, v[0])<BR>WindowsError: [Errno 5] Access is denied<BR><BR>_______________________________________________<BR>Tutor maillist - Tutor@python.org<BR>http://mail.python.org/mailman/listinfo/tutor<BR></BLOCKQUOTE><p>
        
                <hr size=1>Do you Yahoo!?<br>
Check out the new Yahoo! Front Page. <a href="http://www.yahoo.com"> www.yahoo.com</a