Jump to content

Set wallpaper depending on CPU?


Recommended Posts

I had this crazy Idea this morning after looking at this post http://www.msfn.org/board/index.php?showto...=0entry443461

Would it be possible to set a a different wall paper depending wether the CPU is AMD or INTEL? im guessing an autoit or VBS script will do it but I have litlle experience with either, Look forward to any Help :thumbup

Edited by glent
Link to comment
Share on other sites


I'm a user of AutoIt myself, I use the following code in a script I made to itentify the CPU type (WinXP):

$cputype = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString")

if you encorporate that with IF statements or something similar, that will do the trick..

If you want the CPU speed btw, use this one...

$cpuspeed = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "~MHz")

Link to comment
Share on other sites

..some more info I just found..

changing xp wallpaper using registry is done in the following key..

HKEY USERS\ .DEFAULT\Control Panel\Desktop

edit the wallpaper value, and type in the full path of your image and the filename

..so from this I recon if your compitent with AutoIt, you should have enough to make a script to change the wallpaper depending on CPU.

..question is, when do you want to implement this? during setup, or afterwards?

Link to comment
Share on other sites

autoit is very simple :) heres a script i wrote in like 5 minutes.

*Edited* check post below.. new revision forces the windows API to redraw the wallpaper.. but one downside is the API only allows .bmp files.

$readkey = "HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0"
$readstring = "VendorIdentifier"
$wallkey = "HKEY_CURRENT_USER\Control Panel\Desktop"
$wallstring = "Wallpaper"

$type = RegRead($readkey, $readstring)
If @error = -1 Then
MsgBox(0, "Error:", "An error has occured")
Else

If $type = "AuthenticAMD" Then
RegWrite($wallkey, $wallstring, "REG_SZ", "C:\WINDOWS\web\Wallpaper\Bliss.bmp")

ElseIf $type = "GenuineIntel" Then
RegWrite($wallkey, $wallstring, "REG_SZ", "C:\WINDOWS\web\Wallpaper\Red moon desert.jpg")

Else
MsgBox(0, "", "Unknown Processor")

EndIf
EndIf

should be pretty straight forward, it reads the registry for VendorIdentifer.. from what i know, all AMD's are "AuthenticAMD".. and all Intels are "AuthenticIntel"

if an error occurs, it will popup a messagebox saying so.. if you wish to not have a messagebox you can delete that line.

if AuthenticAMD is returned from the registry it will change the wallpaper to Bliss.. if AuthenticIntel is returned, it will change it to "red moon desert"... if it returns anything else besides AMD or intel.. it will show a msgbox saying Unknown Processor.. again you can delete this line if you want.. and it'll use whatever the default wallpaper is.. or you can modify this to use a third wallpaper if you want.

hope this helps, you'll have to compile it since i don't know the location of your pictures.. and don't know how much you would want to tweak it.. not sure when the earliest you can run an autoit compiled script is though..(.exe not .au3)

Edited by Bi0haZarD
Link to comment
Share on other sites

ok... further improvised the code above.. and made it to where it forces the windows API to change the wall paper.. and the registry string for the wallpaper...

HOWEVER!... the windows API only allows .bmp pictures.. so you would have to open the .jpg or whatever in paint then "save as" to 24-bit .bmp (don't think it matters..)

$readkey = "HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0"
$readstring = "VendorIdentifier"
$wallkey = "HKEY_CURRENT_USER\Control Panel\Desktop"
$wallstring = "Wallpaper"
$amdwall = "C:\WINDOWS\web\Wallpaper\Bliss.bmp"
$intelwall = "C:\WINDOWS\web\Wallpaper\Bliss.bmp"

$type = RegRead($readkey, $readstring)
If @error = -1 Then
MsgBox(0, "Error:", "An error has occured")
Else

If $type = "AuthenticAMD" Then
RegWrite($wallkey, $wallstring, "REG_SZ", $amdwall)
DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $amdwall, "int", 0)

ElseIf $type = "GenuineIntel" Then
RegWrite($wallkey, $wallstring, "REG_SZ", $intelwall)
DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $intelwall, "int", 0)

Else
MsgBox(0, "", "Unknown Processor")

EndIf
EndIf

*typo in line 3 corrected*

Edited by Bi0haZarD
Link to comment
Share on other sites

from what i know, all AMD's are "AuthenticAMD".. and all Intels are "AuthenticIntel"

All Intels are "GenuineIntel"

Transmeta Crusoe are "GenuineTMx86"

Old Cyrix are "CyrixInstead"

I would like to know the string for "VIA C3" Processors. I think is "CentaurHauls".

Edited by Nilfred
Link to comment
Share on other sites

ok... further improvised the code above.. and made it to where it forces the windows API to change the wall paper.. and the registry string for the wallpaper...

HOWEVER!... the windows API only allows .bmp pictures.. so you would have to open the .jpg or whatever in paint then "save as" to 24-bit .bmp (don't think it matters..)

$readkey = "HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0"
$readstring = "VendorIdentifier"
$wallkey = "HKEY_CURRENT_USER\Control Panel\Desktop"S
$wallstring = "Wallpaper"
$amdwall = "C:\WINDOWS\web\Wallpaper\Bliss.bmp"
$intelwall = "C:\WINDOWS\web\Wallpaper\yourownfilehere.bmp"

$type = RegRead($readkey, $readstring)
If @error = -1 Then
MsgBox(0, "Error:", "An error has occured")
Else

If $type = "AuthenticAMD" Then
RegWrite($wallkey, $wallstring, "REG_SZ", $amdwall)
DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $amdwall, "int", 0)

ElseIf $type = "GenuineIntel" Then
RegWrite($wallkey, $wallstring, "REG_SZ", $intelwall)
DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $intelwall, "int", 0)

Else
MsgBox(0, "", "Unknown Processor")

EndIf
EndIf

:thumbup you made a small typo on line 3 i changed

$wallkey = "HKEY_CURRENT_USER\Control Panel\Desktop"S

to

$wallkey = "HKEY_CURRENT_USER\Control Panel\Desktop"

compiled and worked great on my athlon 64 system could and intel user please try this and report back please

Edited by glent
Link to comment
Share on other sites

np, glad it worked :) was kinda worried about if autoit worked in 64 bit.

oops for the typo lol. dunno where that S came from :blushing: it's not in my main source :blink:

My server is an Intel Celeron 1.1ghz.. 32 bit of course.. just checked it, and worked perfectly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...