General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
image wallpaper
Posted by: disrupted
Date: September 03, 2009 08:54PM

http://kmext.sourceforge.net/files/imgwallpaper.7z

sets the selected image as desktop wallpaper
access from image contextmenu>set as wallpaper







# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
# ----------sets selected image as desktop wallpaper

$_tool_path=getfolder(RootFolder)."\\Tools";

imgwallpaper{
id(ID_COPY_IMAGE_CONTENT);
exec($_tool_path."\\deskpaper\\deskpaper.exe makewall");
}

imgwallpaper_BuildMenu{
# imagesave
setmenu(ImageSave,inline,img_wallpaper);
setmenu(img_wallpaper,macro,"Set As Wallpaper",imgwallpaper);
}

# ------------------------------------------------------------------------------------
$OnInit=$OnInit."imgwallpaper_BuildMenu;";
$macroModules=$macroModules."imgwallpaper;";


; AutoIt Version: 3.3.0
; Language: English
; Platform: Win9x/NT
; Author: yanni

#Include <ScreenCapture.au3>
#include <ClipBoard.au3>
#include <GUIConstants E x.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <ProgressConstants.au3>
#Include <String.au3>
#Include <File.au3>
#include <Misc.au3>
#notrayicon

if _Singleton("deskpaper",0) = 0 Then
exit
endif

if $cmdline[0]=0 then
msgbox(64, "Hold it!", "Please run me from K-Meleon's menu: image context-menu>Set Wallpaper. ")
exit
else
goon()
endif

func goon()
If FileExists(@ScriptDir & "\deskpaper.ini") Then
letsgo()
else
$wallpaper=Regread("HKCU\Control Panel\Desktop", "Wallpaper")
$wallstyle=Regread("HKCU\Control Panel\Desktop", "WallpaperStyle")
$walltile=Regread("HKCU\Control Panel\Desktop", "TileWallpaper")
IniWrite(@ScriptDir & "\deskpaper.ini", "origwallpaper", 1, $wallpaper)
IniWrite(@ScriptDir & "\deskpaper.ini", "wallstyle", 1, $wallstyle)
IniWrite(@ScriptDir & "\deskpaper.ini", "walltile", 1, $walltile)
letsgo()
endif
endfunc

func letsgo()
$filename=("kmwallpaper.bmp")
$paperpath=(@scriptdir & "\" & $filename)
$defwallpaper=IniRead(@ScriptDir & "\deskpaper.ini", "origwallpaper", "1", "default")
$defstyle=IniRead(@ScriptDir & "\deskpaper.ini", "wallstyle", "1", "default")
$deftile=IniRead(@ScriptDir & "\deskpaper.ini", "walltile", "1", "default")
$wallpapermain = GUICreate("K-Meleon Web Wallpaper", 369, 132, -1, -1, BitOR($WS_SYSMENU, $WS_EX_TOPMOST))
$Label1 = GUICtrlCreateLabel("Set image as desktop wallpaper", 10, 5, 262, 20)
$Label2 = GUICtrlCreateLabel("Select wallpaper style:", 10, 20, 262, 20)
$Label3 = GUICtrlCreateLabel("Select Restore to revert to the original wallpaper", 10, 80, 262, 20)
$Radio_1 = GUICtrlCreateRadio("Centre", 10, 35, 60, 20)
$Radio_2 = GUICtrlCreateRadio("Stretch", 100, 35, 60, 20)
$Radio_3 = GUICtrlCreateRadio("Tile", 190, 35, 62, 20)
$Button_3 = GUICtrlCreateButton("Apply", 268, 20, 86, 20, BitOR($BS_FLAT, $WS_BORDER, $WS_EX_STATICEDGE))
$Button_c = GUICtrlCreateButton("Exit", 268, 44, 86, 20, BitOR($BS_FLAT, $WS_BORDER, $WS_EX_STATICEDGE))
$Button_b = GUICtrlCreateButton("Restore", 268, 76,86, 20, BitOR($BS_FLAT, $WS_BORDER, $WS_EX_STATICEDGE))

GUICtrlSetState($Radio_1, $GUI_CHECKED)
GUISetState()
WinSetOnTop("K-Meleon Web Wallpaper", "", 1)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $Button_3
Select
Case GUICtrlRead($Radio_1) = $GUI_CHECKED
$hbmp = _ClipBoard_GetData($CF_BITMAP )
_ScreenCapture_SaveImage ($paperpath, $hBmp)
RegWrite("HKCU\Control Panel\Desktop", "Wallpaper", "REG_SZ", $paperpath )
RegWrite("HKCU\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", "0" )
RegWrite("HKCU\Control Panel\Desktop", "TileWallpaper", "REG_SZ", "0" )
sleep(44)
Run("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True")

Case GUICtrlRead($Radio_2) = $GUI_CHECKED
$hbmp = _ClipBoard_GetData($CF_BITMAP )
_ScreenCapture_SaveImage ($paperpath, $hBmp)
RegWrite("HKCU\Control Panel\Desktop", "Wallpaper", "REG_SZ", $paperpath )
RegWrite("HKCU\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", "2" )
RegWrite("HKCU\Control Panel\Desktop", "TileWallpaper", "REG_SZ", "0" )
sleep(44)
Run("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True")

Case GUICtrlRead($Radio_3) = $GUI_CHECKED
$hbmp = _ClipBoard_GetData($CF_BITMAP )
_ScreenCapture_SaveImage ($paperpath, $hBmp)
RegWrite("HKCU\Control Panel\Desktop", "Wallpaper", "REG_SZ", $paperpath )
RegWrite("HKCU\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", "0" )
RegWrite("HKCU\Control Panel\Desktop", "TileWallpaper", "REG_SZ", "1" )
sleep(44)
Run("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True")

Endselect
Case $msg = $Button_b
RegWrite("HKCU\Control Panel\Desktop", "Wallpaper", "REG_SZ", $defwallpaper )
RegWrite("HKCU\Control Panel\Desktop", "WallpaperStyle", "REG_SZ", $defstyle )
RegWrite("HKCU\Control Panel\Desktop", "TileWallpaper", "REG_SZ", $deftile )
sleep(44)
Run("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters ,1 ,True")

Case $msg = $Button_c
exit

Case $msg = $GUI_EVENT_CLOSE
exit
Endselect
WEnd
endfunc


Options: ReplyQuote
Re: image wallpaper
Posted by: Paul
Date: September 04, 2009 03:07AM

Most excellent, much needed addition. Good man Disrupted.





Options: ReplyQuote
Re: image wallpaper
Posted by: mslayer
Date: September 04, 2009 03:31AM

I can't get it to work under win98se, there is a missing entry in User32.dll: UpdatePerUserSystemParameters.

Options: ReplyQuote
Re: image wallpaper
Posted by: disrupted
Date: September 04, 2009 01:16PM

thanks paul.. it never came to me mind because i never change the wallpaper and then i read a request and it wasn't too hard

thanks slayer, i wasn't sure it'd work on 9x but i didn't test on my 98 and preferred to use guinea pigs tongue sticking out smiley honestly i don't know the 9x command to refresh wallpaper.. i'll do a search and check at autoit forums as well..and hopefully there is one, if not; we can always automate refreshing desktop(F5) stay tuned

Options: ReplyQuote
Re: image wallpaper
Posted by: disrupted(unlogged)
Date: September 04, 2009 03:19PM

uopdated to work on win9x, download from same link:
http://kmext.sourceforge.net/files/imgwallpaper.7z

if you use win2k and above, you don't really need to download again but this version should be better because its universal. i tested on 98 and works without problems so it should work on win me, but i can't be certain about windows 95.. please test if you have win 95. thanks

Options: ReplyQuote
Re: image wallpaper
Posted by: mslayer
Date: September 04, 2009 10:27PM

It works now, Thanks a lot!

Options: ReplyQuote


K-Meleon forum is powered by Phorum.