bit-tech.net

Go Back   bit-tech.net Forums > Technology > Software

Reply
 
Thread Tools
Old 1st Apr 2015, 14:10   #1
Corky42
I Mod, Therefore I Own
 
Join Date: Oct 2012
Posts: 3,800
Corky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming Saiyan
Edit Current Wallpaper: Solved

Hi,

Wasn't sure if i would be wasting people time with this rather odd request but after a day of Googleing I've given up trying to find a simple solution, I'm looking for a way to open the currently displayed desktop wallpaper in something like paint.net for editing.

The closest thing I've found is a reg file to add a context menu and a VBS script that is meant to open an explorer window and highlight the current image, the only problem is it opens an explorer window but doesn't highlight the image.

I tried editing the VBS script to point to the paint.net exe but with no knowledge of VBS i didn't know if explorer.exe could be replaced with PaintDotNet.exe, or how it should be done if it is possible, it maybe a simple thing for someone with VBS knowledge but it's not for me.

The salient part of the VBS script is as follows..
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
strMsg = "Completed!" & Chr(10) & Chr(10) & "WPTargetDir.vbs -  2010 Ramesh Srinivasan" & Chr(10) & Chr(10) & "Visit us at http://www.winhelponline.com/blog"
strCurWP =""

On Error Resume Next
strCurWP = WshShell.RegRead("HKCU\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource")
On Error Goto 0

If Trim(strCurWP) = "" Then
	MsgBox "No Wallpaper selected for Desktop Slideshow"
Else
	If fso.FileExists(strCurWP) Then
		WshShell.run "explorer.exe" & " /select," & strCurWP
	Else
		MsgBox "Cannot find target for " & strCurWP
	End If
End If
If anyone can point out why it's not highlighting the current image, or even better get paint.net to open the current image it would be much appreciated.

Last edited by Corky42; 3rd Apr 2015 at 07:43.
Corky42 is offline   Reply With Quote
Old 2nd Apr 2015, 11:06   #2
Corky42
I Mod, Therefore I Own
 
Join Date: Oct 2012
Posts: 3,800
Corky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming Saiyan
Just an update, I've gotten a little closer as now the script opens paint.net but i think it's not handling the output from WshShell.RegRead correctly as when paint.net open it says the image type is not recognised.

I have a feeling either the output from reading the registry value or when that output is being passed onto the WshShell.run command for paint.net that it's not handling the fact that the images are on another drive, or that the file names contain spaces.

Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
strCurWP =""

On Error Resume Next
strCurWP = WshShell.RegRead("HKCU\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource")
On Error Goto 0

If Trim(strCurWP) = "" Then
	MsgBox "No Wallpaper selected for Editing"
Else
	If fso.FileExists(strCurWP) Then
		WshShell.run """C:\Program Files\paint.net\PaintDotNet.exe""" & strCurWP
	Else
		MsgBox "Cannot find target for " & strCurWP
	End If
End If
Anyone got some advise on how i should be using WshShell.RegRead or WshShell.run when dealing with files containing spaces that are located on another drive.

EDIT: Sorted it. I had to add & chr(34) before & strCurWP
Now i can edit the current background in paint.net

Last edited by Corky42; 2nd Apr 2015 at 12:01.
Corky42 is offline   Reply With Quote
Old 2nd Apr 2015, 16:05   #3
ferret141
Ultramodder
 
ferret141's Avatar
 
Join Date: Oct 2010
Location: Behind J00 sumware, London
Posts: 1,206
ferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyanferret141 is a Super Spamming Saiyan
Why do you want to do this? Watermark any background?
__________________
i5 2500K | Thermaltake Frio | 2x4GB Corsair Vengeance LP | ASUS P8P67 Pro | EVGA GTX680 2GB SC Signature 2 | Corsair AX1200 | 256GB OCZ Vertex 4 | 1.5TB Samsung F3 | 2TB WD Caviar Black | 3TB WD Red | SONY-NEC BD-5300S BD-RE | Silverstone Raven 2 Evolution (RV02E-BW USB3.0) | ASUS VG278H 3Dv2 | Win7 Ult. 64bit | Creative X-Fi Fatal1ty Platinum Champion Series | Speakers:Logitech G51 | Headset:Beyerdynamics DT770 Pro + ModMic 4.0 | Keyboard:Logitech G15 | Mouse:Logitech G9x
Plusnet | Loadout
ferret141 is offline   Reply With Quote
Old 2nd Apr 2015, 16:21   #4
Corky42
I Mod, Therefore I Own
 
Join Date: Oct 2012
Posts: 3,800
Corky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming Saiyan
I done it so i didn't have to trawl through 3k images trying to find the one being used for the background if it had a border, wasn't in B&W, didn't like it, or anything else i wanted to do with it.

TBH it seems odd that Windows doesn't have something like this built in as trying to find what desktop background you're using is a right PITA.
Corky42 is offline   Reply With Quote
Old 2nd Apr 2015, 19:28   #5
loftie
I *am* a Dremel
 
loftie's Avatar
 
Join Date: Feb 2009
Posts: 1,895
loftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyanloftie is a Super Spamming Saiyan
The original source file- no idea. But I'm pretty sure windows creates a copy of the file in a backgrounds file somewhere because I seem to remember coming across it and finding my five background in it that I had in rotation. Not sure if that'd help you or not.
__________________
Sent from my PC using a keyboard
loftie is offline   Reply With Quote
Old 2nd Apr 2015, 20:15   #6
Cerberus90
petrolhead
 
Cerberus90's Avatar
 
Join Date: Apr 2009
Location: Leicestershire
Posts: 6,851
Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.Cerberus90 is definitely a rep cheat.
current wallpaper image is copied to here

Code:
C:\Users\ [YOURUSERNAME] \AppData\Roaming\Microsoft\Windows\Themes
__________________
Steam: Cerberus90
| i3-4160 3.6GHz | MSI Z97S SLI Krait | 8GiB HyperX Fury 1866 |256GB Samsung 830 |
| Gigabyte GTX660 Windforce| Fractal Core 3000 |

Cerberus90 is offline   Reply With Quote
Old 3rd Apr 2015, 07:43   #7
Corky42
I Mod, Therefore I Own
 
Join Date: Oct 2012
Posts: 3,800
Corky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming SaiyanCorky42 is a Super Spamming Saiyan
To everyone saying where the wallpaper image is stored you have my thanks, but i already knew where it was stored, what i wanted to do and have since done is to be able to right click on the desktop and have paint.net open with the currently displayed image ready for editing.

Basically i modified the reg file and script from the link in my OP to add a context menu that when used runs a modified script, in turn that queries the registry key storing the path to the current wallpaper and then passes that into a command to start paint.net with said image.

I've edited the title to save any confusion as the problem is now solved.
Corky42 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:47.
Powered by: vBulletin Version 3
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.